XElement.LastAttribute Propiedad

Definición

Obtiene el último atributo de este 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 propiedad

XAttribute

XAttribute que contiene el último atributo de este elemento.

Ejemplos

En el ejemplo siguiente se crea un árbol XML con tres atributos. A continuación, escribe el último atributo como salida.

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 ejemplo produce el siguiente resultado:

Att3="3"  

Comentarios

Los atributos se almacenan en el elemento en el orden en que se agregaron al elemento .

Se aplica a

Consulte también