NodeInsertAndDeleteEventHandler Delegate
Represents the method that handles the AfterInsert and BeforeDelete events of an XMLNode control, and the AfterInsert and BeforeDelete events of an XMLNodes control.
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
public delegate void NodeInsertAndDeleteEventHandler( Object^ sender, NodeInsertAndDeleteEventArgs^ e )
Parameters
- sender
-
Type:
System::Object^
The source of the event.
- e
-
Type:
Microsoft.Office.Tools.Word::NodeInsertAndDeleteEventArgs^
A NodeInsertAndDeleteEventArgs that contains the event data.
When you create a NodeInsertAndDeleteEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, until you remove the delegate.
The following code example demonstrates event handlers for the AfterInsert and BeforeDelete events. These event handlers display a message box before an XMLNode is deleted from the document, and after an XMLNode is added to the document. The example also uses the RemoveChild method to delete a node and programmatically raise the BeforeDelete event. This example assumes that the current document contains an XMLNode named CustomerNode that contains a child node named CustomerDateNode.