NanoByte.Common
Public Member Functions | Properties | Events | List of all members
NanoByte.Common.Undo.ICommandManager< T > Interface Template Reference

Executes IUndoCommands for editing a specific object and allows undo/redo operations. More...

Inheritance diagram for NanoByte.Common.Undo.ICommandManager< T >:
NanoByte.Common.Undo.ICommandExecutor NanoByte.Common.Undo.CommandManager< T >

Public Member Functions

void Undo ()
 Undoes the last action performed by ICommandExecutor.Execute. More...
 
void Redo ()
 Redoes the last action undone by Undo. More...
 
void Save ([NotNull] string path)
 Saves the Target to an XML file More...
 
- Public Member Functions inherited from NanoByte.Common.Undo.ICommandExecutor
void Execute ([NotNull] IUndoCommand command)
 Executes an IUndoCommand and stores it for later undo-operations. More...
 

Properties

Target [get, set]
 The object being edited. More...
 
bool UndoEnabled [get]
 Indicates whether there currently are operations that can be Undone. More...
 
bool RedoEnabled [get]
 Indicates whether there currently are operations that can be Redone. More...
 
- Properties inherited from NanoByte.Common.Undo.ICommandExecutor
string Path [get]
 The path of the file the data structure being modified was loaded from. null if none. More...
 

Events

Action TargetUpdated
 Is raised after Target has been updated. More...
 
Action UndoEnabledChanged
 Is raised when the value of UndoEnabled has changed. More...
 
Action RedoEnabledChanged
 Is raised when the value of RedoEnabled has changed. More...
 

Detailed Description

Executes IUndoCommands for editing a specific object and allows undo/redo operations.

Template Parameters
TThe type of the object being edited.
Type Constraints
T :class 

Member Function Documentation

◆ Redo()

Redoes the last action undone by Undo.

Implemented in NanoByte.Common.Undo.CommandManager< T >.

◆ Save()

void NanoByte.Common.Undo.ICommandManager< T >.Save ( [NotNull] string  path)

Saves the Target to an XML file

Parameters
pathThe file to save to.
Exceptions
IOExceptionA problem occurs while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.

Implemented in NanoByte.Common.Undo.CommandManager< T >.

◆ Undo()

Undoes the last action performed by ICommandExecutor.Execute.

Implemented in NanoByte.Common.Undo.CommandManager< T >.

Property Documentation

◆ RedoEnabled

bool NanoByte.Common.Undo.ICommandManager< T >.RedoEnabled
get

Indicates whether there currently are operations that can be Redone.

◆ Target

The object being edited.

◆ UndoEnabled

bool NanoByte.Common.Undo.ICommandManager< T >.UndoEnabled
get

Indicates whether there currently are operations that can be Undone.

This can also be used as an indicator for unsaved changes.

Event Documentation

◆ RedoEnabledChanged

Action NanoByte.Common.Undo.ICommandManager< T >.RedoEnabledChanged

Is raised when the value of RedoEnabled has changed.

◆ TargetUpdated

Action NanoByte.Common.Undo.ICommandManager< T >.TargetUpdated

Is raised after Target has been updated.

◆ UndoEnabledChanged

Action NanoByte.Common.Undo.ICommandManager< T >.UndoEnabledChanged

Is raised when the value of UndoEnabled has changed.


The documentation for this interface was generated from the following file: