Skip to main content

Scripted handler implementation

Overview

Implement those processes for commands and events defined as extension points in the manifest. Functions that implement these processes are called command handlersandevent handlers. Implement those handlers in the script file specified in the entry point in the manifest.

Implementation example

The following is an implementation example of the command handler when the following command is defined in the manifest.

Manifest command definition example

  "extensionPoints": {
"commands": [
{
"id": "Command.SayHello",
"execFunc": "SayHello"
}
],,
...
}

In the above command definition example, implement the command handler named SayHello specified in the extensionPoints.commands [0] .execFunc property as a public function in the entry point script file.

Implementation example of command handler in script file

//Command handler
public void SayHello (ICommandContext context, ICommandParams commandParams)
{
App.Window.UI.ShowInformationDialog ("Hello!", "Hello World");
}
  • For more information on the global objects available in the script, see Global Objects.

See the following references for more information on the arguments passed to the command handler.

important
  • The handler must be implemented as a public function.
  • All handlers must be implemented in the script file specified at the entry point.