Skip to main content

Definition of extension points

Define the next extension point with the extension in the manifest.

  • Ribbon
  • event
  • Command

Expansion point details

For more information on extension points, see Extension points.

Implementation example

Here is an example implementation of a simple extension point that defines one button that performs the function of the extension.

  • In the extensionPoints section, define ribbon, which represents the composition of the ribbon, and commands, which represents the execution command.

  • The ribbon defines the tabs, groups, buttons, and other controls that make up the ribbon.

  • Assign the command to be executed to the button.

    In this example, the extensionPoints.ribbon.tabs [0] .groups [0] .controls [0] .command property is specified with the ID Command.SayHello of the command to be defined later.

  • The command defines the ID and title of the execution command and the function name of the command handler.

    In this example, the command with ID Command.SayHello is defined as the first execution command in the extensionPoints.commands property. The name SayHello in the extensionPoints.commands [0] .execFunc property is the function name of the command handler implemented in the entry point executable program main.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": [
//Groups in the 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

Published JSON Schema Definition (manifest.schema.json) on GitHub to help you edit the manifest. I am. Please download and use it.