Leadtools.Windows.Annotations Namespace > AnnAutomation Class : Undo Method |
public virtual void Undo()
'Declaration Public Overridable Sub Undo()
'Usage Dim instance As AnnAutomation instance.Undo()
public virtual void Undo()
function Leadtools.Windows.Annotations.AnnAutomation.Undo()
public: virtual void Undo();
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.
Private Sub AnnAutomation_Undo(ByVal automation As AnnAutomation) If automation.Container.Children.Count > 0 Then ' select the first object in the automation automation.StartEditing(CType(automation.Container.Children(0), AnnObject), 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
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 AnnObject, 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!"); }
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 AnnObject, 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!"); }
Private Sub AnnAutomation_Undo(ByVal automation As AnnAutomation) If automation.Container.Children.Count > 0 Then ' select the first object in the automation automation.StartEditing(TryCast(automation.Container.Children(0), AnnObject), 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
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2