How to make Undomanager forget last chang


#1

I add a node into a docment and want this operation is unable to undo? How can implement this?

best regards


#2

I assume you are asking about how to use undo/redo programmatically, rather than the user using ^Z and ^Y.
The typical execution sequence, not necessarily all in one method, is:
GoDocument doc = new GoDocument();
doc.UndoManager = new GoUndoManager(); // this turns on recording of changes within transactions
doc.StartTransaction();
// add, modify, and/or remove objects…
doc.FinishTransaction(“made some changes”);
doc.Undo();