XObject 类

定义

表示 XML 树中的节点或属性。Represents a node or an attribute in an XML tree.

public ref class XObject abstract : System::Xml::IXmlLineInfo
public abstract class XObject : System.Xml.IXmlLineInfo
type XObject = class
    interface IXmlLineInfo
Public MustInherit Class XObject
Implements IXmlLineInfo
继承
XObject
派生
实现

注解

此类是 XNodeXAttribute的抽象公共基类。This class is the abstract common base class for XNode and XAttribute. 它提供两个类共有的一些基本功能(如批注),并在节点发生更改时引发事件。It provides some basic functionality that is common to both classes, such as annotations, and raising events when nodes have changed.

请注意,批注不是 XML 信息集的一部分,不对它们进行序列化和反序列化。Note that annotations are not part of the XML infoset; they are not serialized or deserialized.

属性

BaseUri

获取此 XObject 的基 URI。Gets the base URI for this XObject.

Document

获取此 XDocumentXObjectGets the XDocument for this XObject.

NodeType

获取此 XObject 的节点类型。Gets the node type for this XObject.

Parent

获取此 XElement 的父级 XObjectGets the parent XElement of this XObject.

方法

AddAnnotation(Object)

将对象添加到此 XObject 的批注列表。Adds an object to the annotation list of this XObject.

Annotation(Type)

从此 XObject 获取指定类型的第一个批注对象。Gets the first annotation object of the specified type from this XObject.

Annotation<T>()

从此 XObject 获取指定类型的第一个批注对象。Gets the first annotation object of the specified type from this XObject.

Annotations(Type)

获取此 XObject 的指定类型的批注集合。Gets a collection of annotations of the specified type for this XObject.

Annotations<T>()

获取此 XObject 的指定类型的批注集合。Gets a collection of annotations of the specified type for this XObject.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
RemoveAnnotations(Type)

从此 XObject 移除指定类型的批注。Removes the annotations of the specified type from this XObject.

RemoveAnnotations<T>()

从此 XObject 移除指定类型的批注。Removes the annotations of the specified type from this XObject.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

事件

Changed

在此 XObject 或其任何子代发生了更改时引发。Raised when this XObject or any of its descendants have changed.

Changing

当此 XObject 或其任何子代要发生更改时引发。Raised when this XObject or any of its descendants are about to change.

显式接口实现

IXmlLineInfo.HasLineInfo()

获取一个值,该值指示此 XObject 是否具有行信息。Gets a value indicating whether or not this XObject has line information.

IXmlLineInfo.LineNumber

获取基础 XmlReader 为此 XObject 报告的行号。Gets the line number that the underlying XmlReader reported for this XObject.

IXmlLineInfo.LinePosition

获取基础 XmlReader 为此 XObject 报告的行位置。Gets the line position that the underlying XmlReader reported for this XObject.

适用于

另请参阅