Class
UndoRedoService

Service managing the undo redo actions.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class UndoRedoService : IUndoRedoService

Inheritance: objectUndoRedoService

Implements: IUndoRedoService

Constructors

UndoRedoService()

Initializes a new instance of the UndoRedoService class.

Declaration

cs-api-definition
public UndoRedoService()

Properties

IsActive

Gets the is active property.

Declaration

cs-api-definition
public bool IsActive { get; }

Property Value

bool

Determines whether the undoRedo service is executing undo or redo action at the moment.

Implements IUndoRedoService.IsActive

RedoBufferSize

Gets or sets the size of the redo buffer. Must be non-negative integer.

Declaration

cs-api-definition
public int RedoBufferSize { get; set; }

Property Value

int

The size of the redo buffer.

Implements IUndoRedoService.RedoBufferSize

RedoStack

Gets the redo stack.

Declaration

cs-api-definition
public IEnumerable<ICommand> RedoStack { get; }

Property Value

IEnumerable<ICommand>

Implements IUndoRedoService.RedoStack

UndoBufferSize

Gets or sets the size of the undo buffer. Must be non-negative integer.

Declaration

cs-api-definition
public int UndoBufferSize { get; set; }

Property Value

int

The size of the undo buffer.

Implements IUndoRedoService.UndoBufferSize

UndoStack

Gets the undo stack.

Declaration

cs-api-definition
public IEnumerable<ICommand> UndoStack { get; }

Property Value

IEnumerable<ICommand>

Implements IUndoRedoService.UndoStack

Methods

AddCommand(ICommand)

Adds the given command without executing it.

Declaration

cs-api-definition
public void AddCommand(ICommand command)

Parameters

command

ICommand

The command to add.

Implements IUndoRedoService.AddCommand(ICommand)

CanRedo()

Determines whether this instance can redo.

Declaration

cs-api-definition
public bool CanRedo()

Returns

bool

true if this instance can redo; otherwise, false.

Implements IUndoRedoService.CanRedo()

CanUndo()

Determines whether this instance can undo.

Declaration

cs-api-definition
public bool CanUndo()

Returns

bool

true if this instance can undo; otherwise, false.

Implements IUndoRedoService.CanUndo()

Clear()

Clears the undo and redo stacks.

Declaration

cs-api-definition
public virtual void Clear()

Implements IUndoRedoService.Clear()

ExecuteCommand(ICommand, object)

Executes the command.

Declaration

cs-api-definition
public virtual void ExecuteCommand(ICommand command, object state = null)

Parameters

command

ICommand

The command.

state

object

The state.

Implements IUndoRedoService.ExecuteCommand(ICommand, object)

OnActionExecuted(CommandEventArgs)

Raises the ActionExecuted event.

Declaration

cs-api-definition
protected virtual void OnActionExecuted(CommandEventArgs args)

Parameters

args

CommandEventArgs

The CommandEventArgs instance containing the event data.

Redo()

Redoes this instance.

Declaration

cs-api-definition
public virtual void Redo()

Implements IUndoRedoService.Redo()

RemoveCommand(ICommand)

Removes the command.

Declaration

cs-api-definition
public void RemoveCommand(ICommand command)

Parameters

command

ICommand

The command.

Implements IUndoRedoService.RemoveCommand(ICommand)

Undo(object)

Undoes this instance.

Declaration

cs-api-definition
public virtual void Undo(object state = null)

Parameters

state

object

Implements IUndoRedoService.Undo(object)

Events

ActionExecuted

Occurs when either a do or an undo command is executed.

Declaration

cs-api-definition
public event EventHandler<CommandEventArgs> ActionExecuted

Event Value

EventHandler<CommandEventArgs>

Implements IUndoRedoService.ActionExecuted