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
extensionPoints
section, defineribbon
representing the configuration of the ribbon andcommands
representing 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].command
property is given the IDCommand.SayHello
of 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.commands
property defines the command with IDCommand.SayHello
as the first command to execute.
The nameSayHello
in theextensionPoints.commands[0].execFunc
property 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.