Class
AsyncStateCommand

Represents an async state command.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class AsyncStateCommand : UndoableDelegateCommand, IAsyncStateCommand, ICommand

Inheritance: objectUndoableDelegateCommandAsyncStateCommand

Implements: IAsyncStateCommandICommand

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

Constructors

AsyncStateCommand(string, Action<object>, Action<object>, Predicate<object>)

Initializes a new instance of the AsyncStateCommand class.

Declaration

cs-api-definition
public AsyncStateCommand(string name, Action<object> execute, Action<object> undo = null, Predicate<object> canExecute = null)

Parameters

name

string

The name or title of the command.

execute

Action<object>

The redo or execute method.

undo

Action<object>

The undo or rollback method.

canExecute

Predicate<object>

The method returning whether the command can be executed.

Properties

IsCommited

Gets a value indicating whether this instance is committed.

Declaration

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

Property Value

bool

Implements IAsyncStateCommand.IsCommited

Methods

Complete(bool, object)

Completes the execution.

Declaration

cs-api-definition
public void Complete(bool commit, object state)

Parameters

commit

bool

True, if the command should be committed.

state

object

The state.

Implements IAsyncStateCommand.Complete(bool, object)

Execute(object)

Executes an undoable action.

Declaration

cs-api-definition
public override void Execute(object state = null)

Parameters

state

object

Overrides UndoableDelegateCommand.Execute(object)

Implements ICommand.Execute(object)

Events

Completed

Occurs when the command is completed.

Declaration

cs-api-definition
public event EventHandler Completed

Event Value

EventHandler

Implements IAsyncStateCommand.Completed