XmlNodeChangedEventArgs Class
Provides data for the NodeChanged, NodeChanging, NodeInserted, NodeInserting, NodeRemoved and NodeRemoving events.
Assembly: System.Xml (in System.Xml.dll)
The XmlNodeChangedEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | XmlNodeChangedEventArgs | Initializes a new instance of the XmlNodeChangedEventArgs class. |
| Name | Description | |
|---|---|---|
![]() ![]() | Action | Gets a value indicating what type of node change event is occurring. |
![]() ![]() | NewParent | Gets the value of the ParentNode after the operation completes. |
![]() ![]() | NewValue | Gets the new value of the node. |
![]() ![]() | Node | Gets the XmlNode that is being added, removed or changed. |
![]() ![]() | OldParent | Gets the value of the ParentNode before the operation began. |
![]() ![]() | OldValue | Gets the original value of the node. |
| Name | Description | |
|---|---|---|
![]() ![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
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!!");
}
Note |
|---|
If an operation is comprised of multiple actions, it results in multiple events. For example, an AppendChild call may have to remove the node being appended from its previous parent. In this case you will see a NodeRemoved event followed by a NodeInserted event. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
