Share via


XStreamingElement.Name Propriété

Définition

Obtient ou définit le nom de cet élément de diffusion en continu.

public:
 property System::Xml::Linq::XName ^ Name { System::Xml::Linq::XName ^ get(); void set(System::Xml::Linq::XName ^ value); };
public System.Xml.Linq.XName Name { get; set; }
member this.Name : System.Xml.Linq.XName with get, set
Public Property Name As XName

Valeur de propriété

XName

XName qui contient le nom de cet élément de diffusion en continu.

Exemples

Cet exemple crée un élément de streaming, puis imprime le nom de l’élément.

XElement srcTree = new XElement("Root",  
                       new XElement("Child", 1),  
                       new XElement("Child", 2),  
                       new XElement("Child", 3),  
                       new XElement("Child", 4),  
                       new XElement("Child", 5)  
                   );  

XStreamingElement dstTree = new XStreamingElement("NewRoot",  
                        from el in srcTree.Elements()  
                        where (int)el >= 3  
                        select new XElement("DifferentChild", (int)el)  
                    );  

Console.WriteLine(dstTree.Name);  
Dim srcTree As XElement = _  
        <Root>  
            <Child>1</Child>  
            <Child>2</Child>  
            <Child>3</Child>  
            <Child>4</Child>  
            <Child>5</Child>  
        </Root>  

Dim dstTree As XStreamingElement = New XStreamingElement("NewRoot", _  
                From el In srcTree.Elements _  
                Where el.Value >= 3 _  
                Select <DifferentChild><%= el.Value %></DifferentChild> _  
            )  

Console.WriteLine(dstTree.Name)  

Cet exemple produit la sortie suivante :

NewRoot  

S’applique à

Voir aussi