Table of Contents

Class CadPluginManifest

Namespace
OpenCAD2D.Plugins
Assembly
OpenCAD2D.Core.dll

What a plugin says of itself in its plugin.json, read without loading its code (D18 of the plan):

{
  "id": "number-circles",
  "name": "Number circles",
  "version": "1.0.0",
  "author": "Nguyen Thang",
  "kind": "command",
  "minimumApiVersion": "1.0",
  "commands": [ "NUMCIRCLES" ],
  "icon": "icon.png"
}

Only the name is needed; the id is the name where not given, the kind "command", the API version 1.0. A command is a name or an object, { "name": "NUMCIRCLES", "alias": "NC", "description": "Numbers the circles", "usesSelection": true } (CommandEntries); a Python tool, whose process the app starts only when a command is used, also declares what it adds to the ribbon: "ribbon": [ { "id": "tools", "title": "Tools", "panels": [ { "title": "Draw", "buttons": [ { "text": "Number", "command": "NUMCIRCLES", "icon": "number.png", "size": "large", "tooltip": "Numbers the circles" } ] } ] } ] (Ribbon), the object snaps it adds, "snaps": [ { "keyword": "CTOP", "name": "Circle top", "entityTypes": [ "CIRCLE" ], "glyph": "quadrant", "onByDefault": true } ] (Snaps), and the settings the user may change, "settings": [ { "name": "textHeight", "label": "Text height", "kind": "number", "default": 2.5, "minimum": 0.1, "maximum": 1000 } ] (Settings).

public sealed class CadPluginManifest
Inheritance
CadPluginManifest
Inherited Members

Fields

CommandKind

The kind of a command plugin, the only kind this presenter loads: "command".

FileName

The name of the manifest's file: plugin.json.

Properties

Author

Gets the author; empty where not given.

CommandEntries

Gets the commands as declared, in the order written: the names of Commands with the alias, the description and whether the command takes the selection, where the manifest gives them.

Commands

Gets the names of the commands, in capitals, in the order written.

Icon

Gets the path of the icon, relative to the manifest; null where not given.

Id

Gets the id, a short name for the plugin; the name where not given.

Kind

Gets the kind, in small letters: "command" for a command plugin.

MinimumApiVersion

Gets the least version of the plugin API the plugin needs; 1.0 where not given.

Name

Gets the name, which the Plugin manager shows and PLUGINUNLOAD and PLUGINRELOAD are given.

Ribbon

Gets the tabs, panels and buttons the plugin declares for the ribbon, in the order written; none where it declares none.

Settings

Gets the settings a Python tool declares, in the order written; none where it declares none. A C# plugin's settings are declared in its code with CadSettingAttribute, and this list is ignored for it.

Snaps

Gets the object snaps a Python tool declares, in the order written; none where it declares none. A snap with no keyword or no name is passed over.

Version

Gets the plugin's version, as written; empty where not given.

Methods

Parse(string)

Reads a manifest from its JSON text.

Read(string)

Reads a manifest from a plugin.json file, without loading any code.

Refusal()

Says why the presenter does not load the plugin, or null where it may: a kind other than "command", or a newer version of the plugin API than ApiVersion.

ToString()