Class
CompositeCommand

Represents a composite command.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class CompositeCommand : UndoableDelegateCommand, ICommand

Inheritance: objectUndoableDelegateCommandCompositeCommand

Derived Classes: CompositeAsyncStateCommand

Implements: ICommand

Inherited Members UndoableDelegateCommand.Name

Constructors

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

Initializes a new instance of the CompositeCommand class.

Declaration

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

Parameters

name

string

The name or title of the composite action.

execute

Action<object>

The execute action.

undo

Action<object>

The undo action.

canExecute

Predicate<object>

The CanExecute action.

Properties

Commands

Gets the commands.

Declaration

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

Property Value

IEnumerable<ICommand>

Methods

AddCommand(ICommand)

Adds a command to the composite command.

Declaration

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

Parameters

command

ICommand

Returns

CompositeCommand

CanExecute(object)

Returns boolean value indicating whether this command can be executed.

Declaration

cs-api-definition
public override bool CanExecute(object state = null)

Parameters

state

object

Returns

bool

Overrides UndoableDelegateCommand.CanExecute(object)

Clear()

Clears the commands from the composite command.

Declaration

cs-api-definition
public CompositeCommand Clear()

Returns

CompositeCommand

Execute(object)

Executes the specified state.

Declaration

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

Parameters

state

object

Overrides UndoableDelegateCommand.Execute(object)

InsertCommand(int, ICommand)

Inserts a command into the composite command at specific index.

Declaration

cs-api-definition
public CompositeCommand InsertCommand(int position, ICommand command)

Parameters

position

int

command

ICommand

Returns

CompositeCommand

Redo()

Executes and undoable action.

Declaration

cs-api-definition
public override void Redo()

Overrides UndoableDelegateCommand.Redo()

RemoveCommand(ICommand)

Removes a command from the composite command.

Declaration

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

Parameters

command

ICommand

The command.

Returns

CompositeCommand

Undo(object)

Unwinds an undoable action.

Declaration

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

Parameters

state

object

Overrides UndoableDelegateCommand.Undo(object)