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 | Type | Description |
---|---|---|
command | number | The command id. Can be a builtin command enumerated value or custom command id. |
location | CommandLocation | Detailed command location to examine. Possible locations are enumerated. |
includeBuiltInState | boolean | If true, takes the built-in state of the command into account. |
includeScriptSpecifiedState | boolean | If true, accounts for the script-specified state of the command. |
Possible values for the command location are:
Name | Value | Description |
---|---|---|
MFiles.CommandLocation.Undefined | 0 | Undefined value. |
MFiles.CommandLocation.MainMenu | 1 | Specifies the command appearance in the main menus, such as top menu and command bars. |
MFiles.CommandLocation.ContextMenu | 2 | Specifies the command appearance in the context menu. |
MFiles.CommandLocation.ActivityContextMenu | 6 | Specifies the command appearance in the activity context menu. |
Return type
Type | Description |
---|---|
Promise < CommandState > | The command state. |