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

Represents an async state command.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class AsyncStateCommand : UndoableDelegateCommand, IAsyncStateCommand, ICommand

Inheritance: objectUndoableDelegateCommandAsyncStateCommand

Implements: IAsyncStateCommandICommand

Inherited Members UndoableDelegateCommand.Undo(object)UndoableDelegateCommand.Redo()UndoableDelegateCommand.CanExecute(object)UndoableDelegateCommand.Name

Constructors

Initializes a new instance of the AsyncStateCommand class.

C#
public AsyncStateCommand(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 a value indicating whether this instance is committed.

C#
public bool IsCommited { get; }

Implements: IAsyncStateCommand.IsCommited

Methods

Completes the execution.

C#
public void Complete(bool commit, object state)
Parameters:commitbool

True, if the command should be committed.

stateobject

The state.

Implements: IAsyncStateCommand.Complete(bool, object)

Executes an undoable action.

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

Overrides: UndoableDelegateCommand.Execute(object)

Implements: ICommand.Execute(object)

Events

Occurs when the command is completed.

C#
public event EventHandler Completed

Implements: IAsyncStateCommand.Completed