Class Operation
abstract base class for undoable operations within a change tracker.
Inheritance
System.Object
Operation
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TimeCockpit.Data.UndoRedo
Assembly: TimeCockpit.Data.dll
Syntax
public abstract class Operation
Constructors
Operation()
Declaration
protected Operation()
Methods
Redo(ChangeTracker)
called when the operation is to be re applied.
Declaration
public abstract void Redo(ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
ChangeTracker | changeTracker | the change tracker tracking this operation. |
TryMerge(Operation, ChangeTracker)
called when the operation should possibly be merged with the preceeding operation. mainly for setmember operations. The default operation returns false, as most operations cannot be merged.
Declaration
public virtual bool TryMerge(Operation newOperation, ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
Operation | newOperation | the other operation to merge with. |
ChangeTracker | changeTracker | the change tracker governing this operation. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the other operation was merged into this operation and can therefore be discarded. |
Undo(ChangeTracker)
called when the operation is to be undone.
Declaration
public abstract void Undo(ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
ChangeTracker | changeTracker | the change tracker tracking this operation. |