GetCommandState
Description
Gets the command state for builtin or custom command in specified location.
Syntax
// shellFrame points here into the IShellFrame interface
const result = await shellFrame.Commands.GetCommandState(
command,
location,
includeBuiltInState,
includeScriptSpecifiedState,
);
Parameters
Name | Optionality | Type | Description |
---|---|---|---|
command | Required | number | The command id. Can be a builtin command enumerated value or custom command id. |
location | Required | CommandLocation | Detailed command location to examine. Possible locations are enumerated. |
includeBuiltInState | Required | boolean | If true, takes the built-in state of the command into account. |
includeScriptSpecifiedState | Required | boolean | If true, accounts for the script-specified state of the command. |
Possible values for the command location are:
Name | Value | Description |
---|---|---|
Undefined | 0 | Undefined value. |
MainMenu | 1 | Specifies the command appearance in the main menus, such as top menu and command bars. |
ContextMenu | 2 | Specifies the command appearance in the context menu. |
ActivityContextMenu | 6 | Specifies the command appearance in the activity context menu. |
Return type
Type | Description |
---|---|
Promise < CommandState > | The command state. |