Undoes the last operation performed in this
AnnAutomation.
Syntax
Visual Basic (Declaration) | |
---|
Public Overridable Sub Undo() |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnAutomation
instance.Undo()
|
C# | |
---|
public virtual void Undo() |
C++/CLI | |
---|
public:
virtual void Undo(); |
Example
This example selects the first annotation object in the automation container, deletes it, performs an undo, and then redos the operation.
Visual Basic | Copy Code |
---|
Private Sub AnnAutomation_Undo(ByVal automation As AnnAutomation)
If automation.Container.Children.Count > 0 Then
automation.StartEditing(CType(IIf(TypeOf automation.Container.Children(0) Is AnnObjectBase, automation.Container.Children(0), Nothing), AnnObjectBase), False)
MessageBox.Show("Object has been selected. Next delete it")
automation.Delete()
MessageBox.Show("Object has been deleted. Next undo the operation to bring the object back")
automation.Undo()
MessageBox.Show("Operation has been undone and the object is back. Next redo the operation to delete the object again")
automation.Redo()
MessageBox.Show("Operation has been redone and the object is deleted again.")
Else
MessageBox.Show("No objects in the container!")
End If
End Sub |
C# | Copy Code |
---|
private void AnnAutomation_Undo(AnnAutomation automation) { if(automation.Container.Children.Count > 0) { // select the first object in the automation automation.StartEditing(automation.Container.Children[0] as AnnObjectBase, false); MessageBox.Show("Object has been selected. Next delete it"); // delete this object automation.Delete(); MessageBox.Show("Object has been deleted. Next undo the operation to bring the object back"); // undo the delete operation automation.Undo(); MessageBox.Show("Operation has been undone and the object is back. Next redo the operation to delete the object again"); // redo the delete operation automation.Redo(); MessageBox.Show("Operation has been redone and the object is deleted again."); } else MessageBox.Show("No objects in the container!"); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family
See Also