XName.LocalName Proprietà

Definizione

Ottiene la parte locale (non qualificata) del nome.

public:
 property System::String ^ LocalName { System::String ^ get(); };
public string LocalName { get; }
member this.LocalName : string
Public ReadOnly Property LocalName As String

Valore della proprietà

Oggetto String contenente la parte locale (non qualificata) del nome.

Esempio

Nell'esempio seguente viene illustrato l'utilizzo di questa proprietà.

XNamespace ns = "http://www.adventure-works.com";
XElement root = new XElement(ns + "Root", "content");
Console.WriteLine(root.Name);
Console.WriteLine(root.Name.LocalName);
Console.WriteLine(root.Name.Namespace);
Imports <xmlns="http://www.adventure-works.com">

Module Module1
    Sub Main()
        Dim root As XElement = <Root/>
        Console.WriteLine(root.Name)
        Console.WriteLine(root.Name.LocalName)
        Console.WriteLine(root.Name.Namespace)
    End Sub
End Module

In questo esempio viene generato l'output seguente:

{http://www.adventure-works.com}Root
Root
http://www.adventure-works.com

Commenti

Questa proprietà non è garantita come null.

Si applica a

Vedi anche