XmlEvent.RaiseUndoRedoForChanged Property

Gets or sets whether the Changed event will be raised when an undo or redo operation occurs.

Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)

Syntax

'Declaration
'Usage

Property Value

true if the Changed event will be raised; otherwise false.

Remarks

The RaiseUndoRedoForChanged property is used to specify if a user's undo or redo operations raise the Changed event or not. If you set this property to true in event binding code for the Changed event handler in the InternalStartup method, the Changed event will be raised for every undo and redo operation performed on the selected node. This property affects only the Changed event. Undo and redo operations always raise events for the Validating and Changing events.

By default the RaiseUndoRedoForChanged property is set to false, so that the Changed event is not raised for undo and redo operations.

This type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser.

Example

In the following example, the RaiseUndoRedoForChanged property is set to true in the event binding code for the Changing event handler associated with field1 in the InternalStartup method of the FormCode module for the form template. Note that the first line of code in the example is the event binding code generated by InfoPath when the event handler was added in the InfoPath design mode user interface. You should not alter this line of code. The second line of code in the example is the line of code that you add following the event binding code to set the RaiseUndoRedoForChanged property to true so that the Changed event will be raised for undo and redo operations.

EventManager.XmlEvents["/my:myFields/my:field1"].Changed += 
   new XmlChangedEventHandler(field1_Changed);
EventManager.XmlEvents["/my:myFields/my:field1"].
   RaiseUndoRedoForChanged = true;
AddHandler EventManager.XmlEvents("/my:myFields/my:field1").Changed, _
   AddressOf field1_Changed
EventManager.XmlEvents("/my:myFields/my:field1"). _
   RaiseUndoRedoForChanged = True

See Also

Reference

XmlEvent Class
XmlEvent Members
Microsoft.Office.InfoPath Namespace