XElement.LastAttribute Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient le dernier attribut de cet élément.
public:
property System::Xml::Linq::XAttribute ^ LastAttribute { System::Xml::Linq::XAttribute ^ get(); };
public System.Xml.Linq.XAttribute LastAttribute { get; }
member this.LastAttribute : System.Xml.Linq.XAttribute
Public ReadOnly Property LastAttribute As XAttribute
Valeur de propriété
Qui XAttribute contient le dernier attribut de cet élément.
Exemples
L’exemple suivant crée une arborescence XML avec trois attributs. Il écrit ensuite le dernier attribut comme sortie.
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)
Cet exemple produit la sortie suivante :
Att3="3"
Remarques
Les attributs sont stockés dans l’élément dans l’ordre dans lequel ils ont été ajoutés à l’élément.