Visual Basic (Declaration) | |
---|---|
Public Overridable Sub BeginUndo() |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public virtual void BeginUndo() |
C++/CLI | |
---|---|
public: virtual void BeginUndo(); |
This example will manually add a new rectangle object to an automation object and then start editing it.
Visual Basic | Copy Code |
---|---|
Private Sub AnnAutomation_BeginUndo(ByVal automation As AnnAutomation) |
C# | Copy Code |
---|---|
private void AnnAutomation_BeginUndo(AnnAutomation automation) |
Use this method along with the EndUndo and CancelUndo methods to programmatically add a node to the undo stack maintained by this AnnAutomation. Typically, you add an undo node as follows:
Call the BeginUndo method before you make any changes to create a new node. Perform any changes to the AnnAutomation object. Call the EndUndo method to commit this undo node into the undo stack of the AnnAutomation object. In case of errors (typically in a catch statement), call the CancelUndo method to remove the node and cancel the operation.
You do not need to manually call the BeginUndo, EndUndo or CancelUndo methods when calling methods from this AnnAutomation object directly. The AnnAutomation object will internally do this for you. For example, when you call the AnnAutomation.Delete method to delete the object(s) currently being edited, the AnnAutomation object will perform the above sequence internally to add the undo node.
Use the UndoCapacity property to get or set the number of user actions that can be reversed using the Undo method, or re-applied using the Redo method. The default for the UndoCapacity property is 10 actions.
For more information, refer to Undoing WPF Automation Operations.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family