Undoes the last operation performed in this AnnAutomation.
public virtual void Undo()
Public Overridable Sub Undo()
public:
virtual void Undo();
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 WPF Automation Operations.
This example selects the first annotation object in the automation container, deletes it, performs an undo, and then redoes the operation.
Imports Leadtools.Windows.Controls
Imports Leadtools.Windows.Annotations
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
using Leadtools.Windows.Controls;
using Leadtools.Windows.Annotations;
using Leadtools.Demos;
using Leadtools.Help;
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!");
}
using Leadtools.Windows.Controls;
using Leadtools.Windows.Annotations;
using Leadtools.Examples;
using Leadtools.Silverlight.Demos;
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!");
}
Imports Leadtools.Windows.Controls
Imports Leadtools.Windows.Annotations
Imports Leadtools.Silverlight.Demos
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
Products |
Support |
Feedback: Undo Method - Leadtools.Windows.Annotations |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.