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

Base class for undoable actions based on delegates.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class UndoableDelegateCommand : ICommand

Inheritance: objectUndoableDelegateCommand

Derived Classes: AsyncStateCommandCompositeCommandDrawCommand

Implements: ICommand

Constructors

Initializes a new instance of the UndoableDelegateCommand class.

C#
public UndoableDelegateCommand(string name, Action<object> execute, Action<object> undo = null, Predicate<object> canExecute = null)
Parameters:namestring

The name or title of the command.

executeAction<object>

The redo or execute method.

undoAction<object>

The undo or rollback method.

canExecutePredicate<object>

The method returning whether the command can be executed.

Properties

Gets or sets the name.

C#
public string Name { get; set; }
Property Value:

The name.

Implements: ICommand.Name

Methods

Gets a value indicating whether this command can be executed.

C#
public virtual bool CanExecute(object state = null)
Parameters:stateobjectReturns:

bool

Implements: ICommand.CanExecute(object)

Executes an undoable action.

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

Implements: ICommand.Execute(object)

Executes an undoable action.

C#
public virtual void Redo()

Implements: ICommand.Redo()

Unwinds an undoable action.

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

Implements: ICommand.Undo(object)