Preparing files
When developing a script-based extension, create a development folder in any location and prepare the following files.
- Required files
- Manifest file (manifest.json) ... Extension definition
- Script file ... C# script file that serves as the entry point
- Locale file (locale.{lang}.json) ... Definition for each localized language (only required for multilingual support)
For example, when developing an extension named helloworld
using the script method, the basic file structure is as follows.
helloworld/
manifest.json
main.cs
locale.en.json (for multilingual support)
locale.ja.json (for multilingual support)
resources/
button.png
Manifest file
- A Next Design extension must have one file named
manifest.json
. This is called a manifest. - The following definitions are written in this manifest.
- Extension overview
- Entry point file name
- Lifecycle
- Extension points for UI, events, and commands
- Use UTF-8 as the character code for the manifest.
- The icon image on the ribbon specified in the manifest should be prepared as a PNG file.
manifest.json
{
"name": "HelloWorld",
"main": "main.cs",
"lifecycle": "application",
"extensionPoints": {
...
}
}
For more information about manifests, see Manifest Reference.
Script file
- Implement handlers called from extension points defined in the manifest in a script file.
- A file that implements handlers called from extension points is called an entry point.
- Only one entry point can be specified in a manifest. All handlers must be implemented in one entry point.
main.cs
//Public function for command handler
public void SayHello(ICommandContext context,ICommandParams parameters)
{
App.Window.UI.ShowInformationDialog("Hello !", "Hello World");
}
For details about handlers, see Implementing handlers with scripts below.
Prepare locale files (optional)
- If you want to make your extension multilingual, define a locale file named
locale.{lang}.json
for each localized language. - For details about multilingual support, see Multilingual support.