ContextChangeEventHandler Delegate

 

Represents the method that will handle the Select, Deselect, ContextEnter and ContextLeave events of an XMLNode object and the ContextEnter, ContextLeave, Select, and Deselect events of an XMLNodes object.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

public delegate void ContextChangeEventHandler(
	Object^ sender,
	ContextChangeEventArgs^ e
)

Parameters

sender
Type: System::Object^

The source of the event.

e
Type: Microsoft.Office.Tools.Word::ContextChangeEventArgs^

A ContextChangeEventArgs that contains the event data.

When you create a ContextChangeEventHandler 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 XMLNode::Select, XMLNode::Deselect, XMLNode::ContextEnter, and XMLNode::ContextLeave events. When the XMLNode::Select and XMLNode::Deselect events are raised, the event handlers add double lines to the borders of the selection or remove the double lines, depending on the event. When the XMLNode::ContextEnter and XMLNode::ContextLeave events are raised, the event handlers display messages that state the names of the newly selected node and the previously selected node. This example assumes that the current document contains an XMLNode named CustomerNode.

No code example is currently available or this language may not be supported.
Return to top
Show: