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

Represents a composite command.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class CompositeCommand : UndoableDelegateCommand, ICommand

Inheritance: objectUndoableDelegateCommandCompositeCommand

Derived Classes: CompositeAsyncStateCommand

Implements: ICommand

Inherited Members UndoableDelegateCommand.Name

Constructors

Initializes a new instance of the CompositeCommand class.

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

The name or title of the composite action.

executeAction<object>

The execute action.

undoAction<object>

The undo action.

canExecutePredicate<object>

The CanExecute action.

Properties

Commands

IEnumerable<ICommand>

Gets the commands.

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

Methods

Adds a command to the composite command.

C#
public CompositeCommand AddCommand(ICommand command)
Parameters:commandICommandReturns:

CompositeCommand

Returns boolean value indicating whether this command can be executed.

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

bool

Overrides: UndoableDelegateCommand.CanExecute(object)

Clears the commands from the composite command.

C#
public CompositeCommand Clear()
Returns:

CompositeCommand

Executes the specified state.

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

Overrides: UndoableDelegateCommand.Execute(object)

Inserts a command into the composite command at specific index.

C#
public CompositeCommand InsertCommand(int position, ICommand command)
Parameters:positionintcommandICommandReturns:

CompositeCommand

Executes and undoable action.

C#
public override void Redo()

Overrides: UndoableDelegateCommand.Redo()

Removes a command from the composite command.

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

The command.

Returns:

CompositeCommand

Unwinds an undoable action.

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

Overrides: UndoableDelegateCommand.Undo(object)