New to Telerik UI for WinFormsStart a free 30-day trial

Service managing the undo redo actions.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class UndoRedoService : IUndoRedoService

Inheritance: objectUndoRedoService

Implements: IUndoRedoService

Constructors

Initializes a new instance of the UndoRedoService class.

C#
public UndoRedoService()

Properties

Gets the is active property.

C#
public bool IsActive { get; }
Property Value:

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

Implements: IUndoRedoService.IsActive

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

C#
public int RedoBufferSize { get; set; }
Property Value:

The size of the redo buffer.

Implements: IUndoRedoService.RedoBufferSize

RedoStack

IEnumerable<ICommand>

Gets the redo stack.

C#
public IEnumerable<ICommand> RedoStack { get; }

Implements: IUndoRedoService.RedoStack

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

C#
public int UndoBufferSize { get; set; }
Property Value:

The size of the undo buffer.

Implements: IUndoRedoService.UndoBufferSize

UndoStack

IEnumerable<ICommand>

Gets the undo stack.

C#
public IEnumerable<ICommand> UndoStack { get; }

Implements: IUndoRedoService.UndoStack

Methods

Adds the given command without executing it.

C#
public void AddCommand(ICommand command)
Parameters:commandICommand

The command to add.

Implements: IUndoRedoService.AddCommand(ICommand)

Determines whether this instance can redo.

C#
public bool CanRedo()
Returns:

bool

true if this instance can redo; otherwise, false.

Implements: IUndoRedoService.CanRedo()

Determines whether this instance can undo.

C#
public bool CanUndo()
Returns:

bool

true if this instance can undo; otherwise, false.

Implements: IUndoRedoService.CanUndo()

Clears the undo and redo stacks.

C#
public virtual void Clear()

Implements: IUndoRedoService.Clear()

Executes the command.

C#
public virtual void ExecuteCommand(ICommand command, object state = null)
Parameters:commandICommand

The command.

stateobject

The state.

Implements: IUndoRedoService.ExecuteCommand(ICommand, object)

Raises the ActionExecuted event.

C#
protected virtual void OnActionExecuted(CommandEventArgs args)
Parameters:argsCommandEventArgs

The CommandEventArgs instance containing the event data.

Redoes this instance.

C#
public virtual void Redo()

Implements: IUndoRedoService.Redo()

Removes the command.

C#
public void RemoveCommand(ICommand command)
Parameters:commandICommand

The command.

Implements: IUndoRedoService.RemoveCommand(ICommand)

Undoes this instance.

C#
public virtual void Undo(object state = null)
Parameters:stateobject

Implements: IUndoRedoService.Undo(object)

Events

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

C#
public event EventHandler<CommandEventArgs> ActionExecuted

Implements: IUndoRedoService.ActionExecuted