ExecuteCommand
Description
Executes a user command or a built-in command.
This method can execute both custom commands (created via CreateCustomCommand) and built-in commands (from the BuiltinCommand enumeration).
Syntax
// Execute a new custom command with data parameter
await shellFrame.Commands.ExecuteCommand(commandId, {
someCustomData: 1234
});
Parameters
| Name | Optionality | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| commandId | Required | number | The command id. Can be a built-in command enumerated value or custom command id. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| args | Optional | any | Command-specific arguments. Different commands expect different argument structures: | Command | args type | Description | --------- | ----------- | ------------- | NewObject | { TemplateInfo: { Type: number, ClassID?, Name? } } | Object type and optional template info | MakeCopy | { TemplateInfo?: { Type, ClassID, ObjectInfo } } | Optional template for the copy | CheckOut | { ObjectsInfo?: IShellItems } | Objects to check out (uses selection if not provided) | CheckIn | { ObjectsInfo?: IShellItems } | Objects to check in (uses selection if not provided) | UndoCheckOut | { ObjectsInfo?: IShellItems } | Objects to undo checkout (uses selection if not provided) | Delete | { ObjectsInfo?: IShellItems } | Objects to delete (uses selection if not provided) | DownloadFile | { ObjectsInfo?: IShellItems } | Files to download (uses selection if not provided) | OpenFile | { ObjectsInfo?: IShellItems, isDoubleClicked? } | File to open | LaunchDefaultApp | { ObjectsInfo?: IShellItems, isDoubleClicked? } | Open file in default application | BrowseRelatedObjects | { ObjectsInfo?: IShellItems, objectTypeId: number } | Browse related objects of type | ShowHistory | { ObjectsInfo?: IShellItems } | Show version history | RollBack | undefined | Uses selection in history view | Refresh | undefined | No arguments needed | Follow/Unfollow | undefined | Uses current selection |
Return type
| Type | Description |
|---|---|
| Promise < void > | Method does not return a value |