XElement.LastAttribute Propriedade

Definição

Recebe o último atributo deste elemento.

public:
 property System::Xml::Linq::XAttribute ^ LastAttribute { System::Xml::Linq::XAttribute ^ get(); };
public System.Xml.Linq.XAttribute LastAttribute { get; }
public System.Xml.Linq.XAttribute? LastAttribute { get; }
member this.LastAttribute : System.Xml.Linq.XAttribute
Public ReadOnly Property LastAttribute As XAttribute

Valor de Propriedade

An XAttribute que contém o último atributo deste elemento.

Exemplos

O exemplo seguinte cria uma árvore XML com três atributos. Depois escreve o último atributo como saída.

XElement xmlTree = new XElement("Root",
    new XAttribute("Att1", 1),
    new XAttribute("Att2", 2),
    new XAttribute("Att3", 3)
);
Console.WriteLine(xmlTree.LastAttribute);
Dim xmlTree As XElement = <Root Att1="1" Att2="2" Att3="3"/>
Console.WriteLine(xmlTree.LastAttribute)

Este exemplo produz a seguinte saída:

Att3="3"

Observações

Os atributos são armazenados no elemento pela ordem em que foram adicionados ao elemento.

Aplica-se a

Ver também