←Select platform

Undo Method

Summary

Undoes the last operation performed in this AnnAutomation.

Syntax

C#
VB
C++
public virtual void Undo() 
  
Public Overridable Sub Undo()  
public: 
virtual void Undo();  

Remarks

This method will undo the last operation performed in this AnnAutomation if the CanUndo property returns true. 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 Automation Operations. (Deprecated)

Example

This example selects the first annotation object in the automation container, deletes it, performs an undo, and then redos the operation.

C#
VB
using Leadtools; 
using Leadtools.Annotations; 
using Leadtools.WinForms; 
using Leadtools.Drawing; 
 
public void AnnAutomation_Undo(AnnAutomation automation) 
{ 
   if (automation.Container.Objects.Count > 0) 
   { 
      // select the first object in the automation 
      automation.StartEditing(automation.Container.Objects[0], 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!"); 
} 
Imports Leadtools 
Imports Leadtools.Annotations 
Imports Leadtools.WinForms 
Imports Leadtools.Drawing 
 
Public Sub AnnAutomation_Undo(ByVal automation As AnnAutomation) 
   If automation.Container.Objects.Count > 0 Then 
      ' select the first object in the automation 
      automation.StartEditing(automation.Container.Objects(0), 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!") 
   End If 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations Assembly