/// <summary> /// Creates new undo object for recording actions with using pattern. /// </summary> /// <param name="undo">The undo/redo object.</param> /// <param name="snapshotInstance">Instance of an object to record.</param> /// <param name="actionString">Name of action to be displayed in undo stack.</param> /// <param name="customActionBefore">Custom action to append to the undo block action before recorded modifications apply.</param> /// <param name="customActionAfter">Custom action to append to the undo block action after recorded modifications apply.</param> public UndoBlock(Undo undo, object snapshotInstance, string actionString, IUndoAction customActionBefore = null, IUndoAction customActionAfter = null) { _snapshotUndoInternal = snapshotInstance; _undo = undo; _undo.RecordBegin(_snapshotUndoInternal, actionString); _customActionBefore = customActionBefore; _customActionAfter = customActionAfter; }
/// <summary> /// Creates new undo object for recording actions with using pattern. /// </summary> /// <param name="undo">The undo/redo object.</param> /// <param name="snapshotInstance">Instance of an object to record.</param> /// <param name="actionString">Name of action to be displayed in undo stack.</param> public UndoBlock(Undo undo, object snapshotInstance, string actionString) { SnapshotUndoInternal = snapshotInstance; Undo = undo; Undo.RecordBegin(SnapshotUndoInternal, actionString); }