Class UndoManager.CompoundEdit
This class is used to hold a list of ModelChangedEventArgs that should be undone or redone all together because it represents the side-effects of a single logical operation, including user-driven events.
Implements
Namespace: StockSharp.Xaml.Diagram.GXDiagram.Model
Assembly: StockSharp.Xaml.Diagram.dll
Syntax
public sealed class CompoundEdit : Object, IUndoableEdit
Constructors
CompoundEdit()
Construct an empty list of edits.
Declaration
public CompoundEdit()
Properties
Edits
Gets a list of all the IUndoableEdits in this compound edit.
Declaration
public IList<IUndoableEdit> Edits { get; }
Property Value
Type | Description |
---|---|
IList<IUndoableEdit> | A |
Remarks
Each item is normally an instance of ModelChangedEventArgs. However, you may add your own IUndoableEdit objects.
IsComplete
Gets or sets whether we can add more undoable edits to this compound edit.
Declaration
public bool IsComplete { get; set; }
Property Value
Type | Description |
---|---|
Boolean | This is initially false. It can only be set to true, which is what EndTransaction(Boolean, String) does. |
Name
Gets or sets a name for this group of edits.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
String | The default value is null. This is set by EndTransaction(Boolean, String) with the name passed to CommitTransaction(String). |
Methods
CanRedo()
This predicate returns true if you can call Redo()-- namely when IsComplete is true.
Declaration
public bool CanRedo()
Returns
Type | Description |
---|---|
Boolean |
CanUndo()
This predicate returns true if you can call Undo()-- namely when IsComplete is true.
Declaration
public bool CanUndo()
Returns
Type | Description |
---|---|
Boolean |
Clear()
Clear all of the IUndoableEdits and forget all references to them.
Declaration
public void Clear()
Redo()
Redo all of the IUndoableEdits, in forwards order.
Declaration
public void Redo()
ToString()
For debugging.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Undo()
Undo all of the IUndoableEdits, in reverse order.
Declaration
public void Undo()