Interface ICommandManager<T>
Executes IUndoCommands for editing a specific object and allows undo/redo operations.
public interface ICommandManager<T> : ICommandExecutor where T : class
Type Parameters
T
The type of the object being edited.
- Inherited Members
- Extension Methods
Properties
RedoEnabled
Indicates whether there currently are operations that can be Redo()ne.
bool RedoEnabled { get; }
Property Value
- bool
Target
The object being edited.
T? Target { get; set; }
Property Value
- T
UndoEnabled
Indicates whether there currently are operations that can be Undo()ne.
bool UndoEnabled { get; }
Property Value
- bool
Remarks
This can also be used as an indicator for unsaved changes.
Methods
Redo()
Redoes the last action undone by Undo().
void Redo()
Save(string)
Saves the Target to an XML file
void Save(string path)
Parameters
path
stringThe file to save to.
Exceptions
- IOException
A problem occurs while writing the file.
- UnauthorizedAccessException
Write access to the file is not permitted.
Undo()
Undoes the last action performed by Execute(IUndoCommand).
void Undo()
Events
RedoEnabledChanged
Is raised when the value of RedoEnabled has changed.
event Action? RedoEnabledChanged
Event Type
- Action
TargetUpdated
Is raised after Target has been updated.
event Action? TargetUpdated
Event Type
- Action
UndoEnabledChanged
Is raised when the value of UndoEnabled has changed.
event Action? UndoEnabledChanged
Event Type
- Action