Show / Hide Table of Contents

Interface ICommandManager<T>

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

Inherited Members
ICommandExecutor.Execute(IUndoCommand)
ICommandExecutor.Path
Namespace: NanoByte.Common.Undo
Assembly: NanoByte.Common.dll
Syntax
public interface ICommandManager<T> : ICommandExecutor where T : class
Type Parameters
Name Description
T

The type of the object being edited.

Properties

RedoEnabled

Indicates whether there currently are operations that can be Redo()ne.

Declaration
bool RedoEnabled { get; }
Property Value
Type Description
Boolean

Target

The object being edited.

Declaration
T Target { get; set; }
Property Value
Type Description
T

UndoEnabled

Indicates whether there currently are operations that can be Undo()ne.

Declaration
bool UndoEnabled { get; }
Property Value
Type Description
Boolean
Remarks

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

Methods

Redo()

Redoes the last action undone by Undo().

Declaration
void Redo()

Save(String)

Saves the Target to an XML file

Declaration
void Save(string path)
Parameters
Type Name Description
String path

The file to save to.

Exceptions
Type Condition
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).

Declaration
void Undo()

Events

RedoEnabledChanged

Is raised when the value of RedoEnabled has changed.

Declaration
event Action RedoEnabledChanged
Event Type
Type Description
Action

TargetUpdated

Is raised after Target has been updated.

Declaration
event Action TargetUpdated
Event Type
Type Description
Action

UndoEnabledChanged

Is raised when the value of UndoEnabled has changed.

Declaration
event Action UndoEnabledChanged
Event Type
Type Description
Action

Extension Methods

UpdateUtils.To<TIn, TOut>(TIn, Func<TIn, TOut>)
JsonStorage.SaveJson<T>(T, Stream)
JsonStorage.SaveJson<T>(T, String)
JsonStorage.ToJsonString<T>(T)
JsonStorage.ReparseAsJson<T>(Object)
JsonStorage.ReparseAsJson<T>(Object, T)
XmlStorage.SaveXml(Object, Stream, String)
XmlStorage.SaveXml<T>(T, String, String)
XmlStorage.ToXmlString(Object, String)
ConversionUtils.ConvertToString<TType>(TType)
In This Article
Back to top Copyright Bastian Eicher