define extension points
Define the following extension points by extension in your manifest:
- Ribbon
- event
- command
Extension point details
For more information about extension points, see extension points.
Implementation example
Here is an example implementation of a simple extension point that defines a single button that executes the functionality of the extension.
-
In the
extensionPointssection, defineribbonrepresenting the configuration of the ribbon andcommandsrepresenting the execution commands. -
The ribbon defines the tabs, groups, and controls such as buttons that make up the ribbon.
-
Assign the command to execute to the button.
In this example, the
extensionPoints.ribbon.tabs[0].groups[0].controls[0].commandproperty is given the IDCommand.SayHelloof the command defined later. -
Command defines the ID and title of the execution command and the function name of the command handler.
In this example, the
extensionPoints.commandsproperty defines the command with IDCommand.SayHelloas the first command to execute.
The nameSayHelloin theextensionPoints.commands[0].execFuncproperty is the function name of the command handler implemented in the entry point executablemain.cs.
{
//extension definition
"name": "Hello World",
"main": "main.cs",
"lifecycle": "application",
//extension point definition
"extensionPoints": {
//ribbon
"ribbon": {
"tabs": [
//ribbon tab
{
"id": "HelloWorld.MainTab",
"label": "Hello World",
"orderBefore": "System.View",
"groups": [
//group in ribbon tab
{
"id": "HelloWorld.FirstGroup",
"label": "Group 1",
"controls": [
//button
{
"id": "HelloWorld.SayHelloButton",
"type": "Button",
"label": "Say Hello",
"imageLarge": "images/About.png",
"command": "Command.SayHello"
}
]
}
]
}
]
},
//command
"commands": [
{
"id": "Command.SayHello",
"execFunc": "SayHello"
}
]
}
}
JSON Schema
Publish JSON schema definition (manifest.schema.json) on GitHub to help with manifest editing. I'm here. Please download and use it.