Extension point definition

Description

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

  • Ribbon
  • Event
  • Command

Reference

Tip

Implementation example

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

  • In the extensionPoints section, define ribbon that represents the ribbon configuration and commands that represents the execution commands.
  • The ribbon defines controls such as tabs, groups, and buttons 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 has 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 of the extensionPoints.commands[0].execFunc property is the function name of the command handler implemented in the execution program main.cs of the entry point.

manifest.json

{
  //extension definition
  "name": "HelloWorld",
  "main": "main.cs",
  "lifecycle": "application",

  //extension point definition
  "extensionPoints": {
    //ribbon
    "ribbon": {
      "tabs": [
        //Ribbon tab
        {
          "id": "HelloWorld.MainTab",
          "label": "HelloWorld",
          "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"
      }
    ]
  }
}