The type of the operation is taken
from the XObjetChangeEventArgs argument.
// Create a Changing event for the ClassicIcecreams
element
// Show message with details that will be changing
ClassicIcecreams.Changing += new XObjectChangeEventHandler(
delegate(object objSender, XObjectChangeEventArgs args)
{
XElement eleSend = (XElement)objSender;
MessageBox.Show("XML is Changing " + " \n " +
" Sender: " + eleSend.Name.LocalName +
" Operation: " + args.ObjectChange.ToString(),,
"Changing Event");
}
);
Create another new XObjectChangeEventHandler with the similar parameters and
types as we used for the previous example. This event handler is for handling the
changed event of the XML tree. Assign this event to the Changed event property
of the XML. This event will be fired after changing the XML tree. Here, also, we are
displaying the sender's name and the change operation that caused the event to fire.
// Create a Changed event for the ClassicIcecreams element
// Show message with the details that got changed
ClassicIcecreams.
Pages:
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131