XComment.NodeType Özellik

Tanım

Bu düğümün düğüm türünü alır.

public:
 virtual property System::Xml::XmlNodeType NodeType { System::Xml::XmlNodeType get(); };
public override System.Xml.XmlNodeType NodeType { get; }
member this.NodeType : System.Xml.XmlNodeType
Public Overrides ReadOnly Property NodeType As XmlNodeType

Özellik Değeri

XmlNodeType

Düğüm türü. Nesneler için XComment bu değer şeklindedir Comment.

Örnekler

Aşağıdaki örnek bir açıklama düğümü oluşturur ve düğüm türünü yazdırır.

XComment com = new XComment("This is a comment");  
XNode node = com;  
Console.WriteLine(node.NodeType);  
Dim com As XComment = New XComment("This is a comment")  
Dim node As XNode = com  
Console.WriteLine(node.NodeType.ToString())  

Bu örnek aşağıdaki çıkışı oluşturur:

Comment  

Açıklamalar

'den türetilen tüm sınıflar bir NodeType özellik içerdiğindenXObject, somut alt sınıfı XObjectkoleksiyonları üzerinde çalışan kod yazabilirsiniz. Kodunuz daha sonra koleksiyondaki her düğümün düğüm türünü test edebilir.

Şunlara uygulanır

Ayrıca bkz.