File

projects/wms-framework/src/lib/baseframework/ICommand.ts

Description

Represents a Command that can be executed.

Index

Properties
Methods

Methods

CanExecute
CanExecute(parameter?: any)

Query if the command can be executed.

Parameters :
Name Type Optional
parameter any Yes
Returns : boolean

{boolean} true the command can be executed, false otherwise.

Execute
Execute(parameter?: any)

Executes the command if it can be executed.

Parameters :
Name Type Optional
parameter any Yes
Returns : void

Properties

CanExecuteChanged
CanExecuteChanged: SubscriptionEvent<any>
Type : SubscriptionEvent<any>

Event trigerred when CanExecute changes its value.

import { SubscriptionEvent } from '../utils/SubscriptionEvent';

/**
 * Represents a Command that can be executed.
 *
 * @export
 * @interface ICommand
 * @wInterface System.Windows.Input.ICommand
 */
export interface ICommand {
  /**
   * Event trigerred when `CanExecute` changes its value.
   *
   * @type {SubscriptionEvent<any>}
   * @memberof ICommand
   */
  CanExecuteChanged: SubscriptionEvent<any>;

  /**
   * Query if the command can be executed.
   *
   * @param {*} [parameter]
   * @return {*}  {boolean} `true` the command can be executed, `false` otherwise.
   * @memberof ICommand
   */
  CanExecute(parameter?: any): boolean;

  /**
   * Executes the command if it can be executed.
   *
   * @param {*} [parameter]
   * @memberof ICommand
   */
  Execute(parameter?: any): void;
}

result-matching ""

    No results matching ""