publicvirtualvoidBeginUndo()
PublicOverridableSubBeginUndo()
-(void) beginUndo;
publicvoidbeginUndo()
public:virtualvoidBeginUndo()
UseBeginUndo,EndUndoandCancelUndoto programmatically add a node to the undo stack maintained by this一个nnAutomation. Typically, you add an undo node as follows:
Call theBeginUndomethod before you make any changes to create a new node.
Perform any changes to the一个nnAutomationobject.
Call theEndUndomethod to commit this undo node into the undo stack of the一个nnAutomationobject.
In case of errors (typically in a catch statement), call theCancelUndomethod to remove the node and cancel the operation.
You do not need to manually callBeginUndo,EndUndoorCancelUndowhen calling methods from this一个nnAutomationobject. The一个nnAutomationobject will internally do this for you. For example, when you call theDeleteSelectedObjectsmethod to delete the object(s) currently being edited, the一个nnAutomationobject will perform the above sequence internally to add the undo node.
Use theUndoCapacityproperty to get or set the number of user actions that can be reversed using theUndomethod, or re-applied using theRedomethod. The default for theUndoCapacityproperty is 10 actions.
For information on undoing or redoing automation operations, refer toUndoing Annotation Automation Operations.
This example will manually add a new rectangle object to an automation object and then start editing it.
usingLeadtools.Annotations.Automation;usingLeadtools.Annotations.Engine;usingLeadtools.Codecs;usingLeadtools.Controls;usingLeadtools.Annotations.Rendering;usingLeadtools.Annotations.WinForms;publicvoid一个nnAutomation_BeginUndo(){// first create a new undo node_automation.BeginUndo();try{// add a new rectangle object一个nnRectangleObject rectObj =new一个nnRectangleObject();rectObj.Rect = LeadRectD.Create(100, 100, 800, 800);rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(1));rectObj.Fill = AnnSolidColorBrush.Create("Yellow");_automation.Container.Children.Add(rectObj);// Invalidate it_automation.Invalidate(LeadRectD.Empty);// Select this object_automation.SelectObject(rectObj);// commit the undo node_automation.EndUndo();}catch(Exception ex){// in case of errors, cancel the undo node_automation.CancelUndo();Debug.WriteLine(ex.Message);return;}Debug.WriteLine("Object has been added as is now selected. Next will call //Undo// to undo the operation");_automation.Undo();Debug.WriteLine("Operation has been undone. Next will call //Redo// to redo the operation");_automation.Redo();Debug.WriteLine("Object should be back and selected");}
Help Collections
Raster.NET|C API|C++ Class Library|HTML5 JavaScript
Document.NET|C API|C++ Class Library|HTML5 JavaScript
米edical.NET|C API|C++ Class Library|HTML5 JavaScript
米edical Web Viewer.NET
188宝金博怎么下载
米edia Foundation.NET|C API|Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
米onday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
请填写表单重新开始一个新的聊天.
一个ll agents are currently offline.
Chat Hours:
米onday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.
