XmlNodeChangedEventArgs 类

定义

提供以下事件的数据:NodeChangedNodeChangingNodeInsertedNodeInsertingNodeRemovedNodeRemovingProvides data for the NodeChanged, NodeChanging, NodeInserted, NodeInserting, NodeRemoved and NodeRemoving events.

public ref class XmlNodeChangedEventArgs : EventArgs
public class XmlNodeChangedEventArgs : EventArgs
type XmlNodeChangedEventArgs = class
    inherit EventArgs
Public Class XmlNodeChangedEventArgs
Inherits EventArgs
继承
XmlNodeChangedEventArgs

注解

下面C#的代码演示如何使用事件处理程序。The following C# code shows how to use the event handler.

//Add a new event handler.  
XmlDocument doc = new XmlDocument();  
doc.NodeInserted += new XmlNodeChangedEventHandler(NodeInsertedHandler);  
//Define the event handler.  
void NodeInsertedHandler(Object src, XmlNodeChangedEventArgs args)  
{  
 Console.WriteLine("Node " + args.Node.Name + " inserted!!");  
}  

备注

如果操作由多个操作组成,则会生成多个事件。If an operation is comprised of multiple actions, it results in multiple events. 例如,AppendChild 调用可能必须删除从其上一个父级追加的节点。For example, an AppendChild call may have to remove the node being appended from its previous parent. 在这种情况下,你将看到 NodeRemoved 事件,后跟 NodeInserted 事件。In this case you will see a NodeRemoved event followed by a NodeInserted event.

构造函数

XmlNodeChangedEventArgs(XmlNode, XmlNode, XmlNode, String, String, XmlNodeChangedAction)

初始化 XmlNodeChangedEventArgs 类的新实例。Initializes a new instance of the XmlNodeChangedEventArgs class.

属性

Action

获取一个值,该值指示正在发生哪种类型的节点更改事件。Gets a value indicating what type of node change event is occurring.

NewParent

获取操作完成后 ParentNode 的值。Gets the value of the ParentNode after the operation completes.

NewValue

获取节点的新值。Gets the new value of the node.

Node

获取正被添加、移除或更改的 XmlNodeGets the XmlNode that is being added, removed or changed.

OldParent

获取操作开始前的 ParentNode 的值。Gets the value of the ParentNode before the operation began.

OldValue

获取节点的原始值。Gets the original value of the node.

方法

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)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅