XmlElement.ParentNode 属性

定义

获取该节点的父级(针对可以拥有父级的节点)。Gets the parent of this node (for nodes that can have parents).

public:
 virtual property System::Xml::XmlNode ^ ParentNode { System::Xml::XmlNode ^ get(); };
public override System.Xml.XmlNode ParentNode { get; }
public override System.Xml.XmlNode? ParentNode { get; }
member this.ParentNode : System.Xml.XmlNode
Public Overrides ReadOnly Property ParentNode As XmlNode

属性值

XmlNode

作为当前节点父级的 XmlNodeThe XmlNode that is the parent of the current node. 如果刚刚创建了一个节点且尚未将其添加到树中,或如果已从树中移除了该节点,则父级为 nullIf a node has just been created and not yet added to the tree, or if it has been removed from the tree, the parent is null. 对于所有其他节点,返回的值取决于节点的 NodeTypeFor all other nodes, the value returned depends on the NodeType of the node. 下表描述了 ParentNode 属性可能的返回值。The following table describes the possible return values for the ParentNode property.

适用于