C# Класс Microsoft.Practices.Prism.Commands.CompositeCommand

The CompositeCommand composes one or more ICommands.
Наследование: ICommand
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CanExecute ( object parameter ) : bool

Forwards ICommand.CanExecute to the registered commands and returns if all of the commands return .

CompositeCommand ( ) : Microsoft.Practices.Prism.Properties

Initializes a new instance of CompositeCommand.

CompositeCommand ( bool monitorCommandActivity ) : Microsoft.Practices.Prism.Properties

Initializes a new instance of CompositeCommand.

Execute ( object parameter ) : void

Forwards ICommand.Execute to the registered commands.

RegisterCommand ( ICommand command ) : void

Adds a command to the collection and signs up for the ICommand.CanExecuteChanged event of it.

If this command is set to monitor command activity, and command implements the IActiveAware interface, this method will subscribe to its IActiveAware.IsActiveChanged event.

UnregisterCommand ( ICommand command ) : void

Removes a command from the collection and removes itself from the ICommand.CanExecuteChanged event of it.

Защищенные методы

Метод Описание
OnCanExecuteChanged ( ) : void

Raises ICommand.CanExecuteChanged on the UI thread so every command invoker can requery ICommand.CanExecute to check if the CompositeCommand can execute.

ShouldExecute ( ICommand command ) : bool

Evaluates if a command should execute.

If this command is set to monitor command activity, and command implements the IActiveAware interface, this method will return if the command's IActiveAware.IsActive property is ; otherwise it always returns .

Приватные методы

Метод Описание
Command_IsActiveChanged ( object sender, EventArgs e ) : void

Handler for IsActiveChanged events of registered commands.

OnRegisteredCommandCanExecuteChanged ( object sender, EventArgs e ) : void

Описание методов

CanExecute() публичный Метод

Forwards ICommand.CanExecute to the registered commands and returns if all of the commands return .
public CanExecute ( object parameter ) : bool
parameter object Data used by the command. /// If the command does not require data to be passed, this object can be set to . ///
Результат bool

CompositeCommand() публичный Метод

Initializes a new instance of CompositeCommand.
public CompositeCommand ( ) : Microsoft.Practices.Prism.Properties
Результат Microsoft.Practices.Prism.Properties

CompositeCommand() публичный Метод

Initializes a new instance of CompositeCommand.
public CompositeCommand ( bool monitorCommandActivity ) : Microsoft.Practices.Prism.Properties
monitorCommandActivity bool Indicates when the command activity is going to be monitored.
Результат Microsoft.Practices.Prism.Properties

Execute() публичный Метод

Forwards ICommand.Execute to the registered commands.
public Execute ( object parameter ) : void
parameter object Data used by the command. /// If the command does not require data to be passed, this object can be set to . ///
Результат void

OnCanExecuteChanged() защищенный Метод

Raises ICommand.CanExecuteChanged on the UI thread so every command invoker can requery ICommand.CanExecute to check if the CompositeCommand can execute.
protected OnCanExecuteChanged ( ) : void
Результат void

RegisterCommand() публичный Метод

Adds a command to the collection and signs up for the ICommand.CanExecuteChanged event of it.
If this command is set to monitor command activity, and command implements the IActiveAware interface, this method will subscribe to its IActiveAware.IsActiveChanged event.
public RegisterCommand ( ICommand command ) : void
command ICommand The command to register.
Результат void

ShouldExecute() защищенный Метод

Evaluates if a command should execute.
If this command is set to monitor command activity, and command implements the IActiveAware interface, this method will return if the command's IActiveAware.IsActive property is ; otherwise it always returns .
protected ShouldExecute ( ICommand command ) : bool
command ICommand The command to evaluate.
Результат bool

UnregisterCommand() публичный Метод

Removes a command from the collection and removes itself from the ICommand.CanExecuteChanged event of it.
public UnregisterCommand ( ICommand command ) : void
command ICommand The command to unregister.
Результат void