XObject.Changing Event
Imports System
Imports System.Xml
Imports System.Xml.Schema
Module Module1
WithEvents root As XElement = <Root>content</Root>
Sub Main()
root.Add(<Child>child</Child>)
End Sub
Private Sub root_Changing( _
ByVal sender As Object, _
ByVal e As XObjectChangeEventArgs) _
Handles root.Changing
Dim xSender As XElement = CType(sender, XElement)
Console.WriteLine("Changing event raised")
Console.WriteLine(" Sender: {0}", xSender.Name)
Console.WriteLine(" ObjectChange: {0}", e.ObjectChange)
End Sub
Private Sub root_Changed( _
ByVal sender As Object, _
ByVal e As XObjectChangeEventArgs) _
Handles root.Changed
Dim xSender As XElement = CType(sender, XElement)
Console.WriteLine("Changed event raised")
Console.WriteLine(" Sender: {0}", xSender.Name)
Console.WriteLine(" ObjectChange: {0}", e.ObjectChange)
End Sub
End Module
Related examples in the same category