SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 280 | Next

Scott Klein

"Professional LINQ"

More important, however, are the next
two: the actual name of the element that was affected, and the operation performed, in this case, an Add
(an element was added).
Because Changing was placed on the root node, any change to the XML tree would have fired it.
To really see how this works, modify the code as follows (highlighted lines), then place a breakpoint on
the empXML.Changing line. This example doesn??™t add a new element; rather, it updates the value of an
existing element.
XElement empXML = new XElement("Employees",
new XElement("Employee",
new XAttribute("id", "1"),
new XAttribute("Dept", "0001"),
new XElement("Name", "Scott"),
new XElement("Address",
new XElement("Street", "555 Main St."),
new XElement("City", "Wellington"),
new XElement("State", "FL"),
new XElement("Zip", "33414")),
new XElement("Title", "All Things Techy"),
new XElement("HireDate", "02/05/2007"),
new XElement("Gender", "M")
)
);
empXML.Changing += new XObjectChangeEventHandler(delegate(object xsender,
XObjectChangeEventArgs cea)
{
listBox1.


Pages:
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6