projects/wms-framework/src/lib/infra/CommandBase.ts
Basic implementation of CommandBase class.
Properties |
|
Methods |
Accessors |
CanExecuteChanged |
Type : SubscriptionEvent<any>
|
Default value : new SubscriptionEvent()
|
Event trigerred when |
Private commandSource |
Type : any
|
Default value : null
|
Stores the |
CanExecute | ||||||
CanExecute(parameter?: any)
|
||||||
Query if the command can be executed.
Parameters :
Returns :
boolean
{boolean} |
Execute | ||||||
Execute(parameter?: any)
|
||||||
Executes the command if it can be executed.
Parameters :
Returns :
void
|
CommandSource | ||||||
getCommandSource()
|
||||||
Gets or sets the command source.
Returns :
any
|
||||||
setCommandSource(value: any)
|
||||||
Parameters :
Returns :
void
|
import { ICommand } from '../baseframework/ICommand';
import { Debugger } from '../diagnostics/Debugger';
import { SubscriptionEvent } from '../utils/SubscriptionEvent';
/**
* Basic implementation of CommandBase class.
*
* @export
* @class CommandBase
* @implements {ICommand}
* @wType Infragistics.CommandBase
*/
export class CommandBase implements ICommand {
/**
* Event trigerred when `CanExecute` changes its value.
*
* @type {SubscriptionEvent<any>}
* @memberof CommandBase
*/
CanExecuteChanged: SubscriptionEvent<any> = new SubscriptionEvent();
/**
* Stores the `CommandSource` value.
*
* @private
* @type {*}
* @memberof CommandBase
*/
private commandSource: any = null;
/**
* Query if the command can be executed.
*
* @param {*} [parameter]
* @return {*} {boolean}
* @memberof CommandBase
* @wNoMap
*/
CanExecute(parameter?: any): boolean {
Debugger.RegisterUse('Infragistics_CommandBase.CanExecute');
return true;
}
/**
* Executes the command if it can be executed.
*
* @param {*} [parameter]
* @memberof CommandBase
* @wNoMap
*/
Execute(parameter?: any): void {
Debugger.RegisterUse('Infragistics_CommandBase.Execute');
}
/**
* Gets or sets the command source.
*
* @type {*}
* @memberof CommandBase
*/
get CommandSource(): any {
return this.commandSource;
}
set CommandSource(value: any) {
this.commandSource = value;
}
}