Table of Contents

OpenCAD2D.Plugins

Type Kind Summary
CadCanvasMenuProvider delegate What a plugin adds to the right-click menu of the canvas, as AutoCAD's object context menu extension does: items after those of the extensions and before the presenter's own, asked with objects selected and no command running; the objects are CadPluginContext.Selected.
CadCommandAttribute class Marks a method of a plugin as a command, as AutoCAD's [CommandMethod] does: [CadCommand("NUMCIRCLES", Alias = "NC")] on public IEnumerable<CadPrompt> NumberCircles(CadCommandContext c).
CadCustomSnap class An object snap a plugin adds, as AutoCAD's CustomObjectSnapMode: a name, a keyword typed as an override, a glyph, the entity types it applies to and the points the plugin works out for an entity under the cursor.
CadDrawingsMenuProvider delegate What a plugin adds to the right-click menu of a row of DRAWINGS: items at its end, after a separator, asked each time the menu opens, for the rows that are files and not for folder headers.
CadDrawingsRequest class What a DRAWINGS menu provider is given when the right-click menu of a row opens.
CadLoadedPlugin class A plugin CadPluginManager knows in this session: where it was loaded from, whether it is loaded now, whether it lies in the plugin folder or is on the startup list, and the plugin itself while it is loaded.
CadPlugin class A command plugin made from its assemblies: the methods marked CadCommandAttribute as commands, the properties marked CadSettingAttribute as settings, found by reflection, and added to the command lines of the open drawings with CadPlugin.AddTo.
CadPluginAction enum What was done to a plugin, as the load log says it.
CadPluginApiAttribute class Says which version of the plugin API an assembly needs at least, as [assembly: CadPluginApi("1.0")].
CadPluginBuild class What compiling a plugin given as a folder with a .csproj gave (CadPluginLoader.Compile): the assembly and its PDB, or the errors that kept it from being built.
CadPluginButton class A button a plugin puts in the header of the DRAWINGS list, left of the presenter's Refresh and Open: an icon with a tooltip that runs a callback.
CadPluginCommand class One command of a plugin: its name, alias and description as its attribute gives them, and the command the registry runs.
CadPluginCommandEntry class One command a plugin.json declares, written as a name ("RING") or as an object that says more: { "name": "RING", "alias": "RG", "description": "Draws a ring", "usesSelection": true }.
CadPluginContext class What a callback of a plugin is given when the window runs it: a ribbon button's, a DRAWINGS button's, a menu item's, a button's CanRun or a contextual tab's ShowWhen.
CadPluginException class A plugin refused, or one of its commands failed: the message names the plugin, and the exception it threw is the inner one.
CadPluginHost class What a plugin adds to the window in ICadPluginApplication.Initialize: ribbon tabs and panels, Properties rows, DRAWINGS buttons and menu items, canvas menu items and object snaps.
CadPluginIcon class The picture of a ribbon button or a DRAWINGS button, described without WPF: path data, or the bytes of an image.
CadPluginLoader class Loads the assemblies of a plugin for CadPluginManager, and unloads them, as the runtime allows: on .NET 8 each plugin into a collectible load context of its own, which unloading frees; on .NET Framework into the one AppDomain, from which nothing is ever unloaded.
CadPluginLogEntry class One line of the load log the Plugin manager shows: when, which plugin, what, from where, whether trusted, and what came of it.
CadPluginManager class The command plugins of the presenter, as AutoCAD's NETLOAD and APPLOAD keep them (A14 of the plan): loaded from a .dll, the folder of one, or the plugin folder, unloaded and loaded again while the presenter runs, their commands added to the command line of every drawing open (CadPluginManager.Attach), every load written in the load log (CadPluginManager.Log) and logged with its full path.
CadPluginManifest class 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.
CadPluginMenuItem class An item of a menu a plugin adds to, as the presenter's CadExtensionMenuItem is for an extension: a line that runs a callback, a submenu, or a separator, ticked or not, on or off.
CadPluginResult class What came of a load, unload or reload: whether it was done, the sentence the command line writes, and what was left out.
CadPluginRibbonButtonEntry class One button of a panel of the "ribbon" of a plugin.json: { "text": "Ring", "command": "RING", "icon": "ring.png", "size": "large", "tooltip": "Draws a ring" }.
CadPluginRibbonPanelEntry class One panel of a tab of the "ribbon" of a plugin.json: { "title": "Draw", "buttons": [ ... ] }.
CadPluginRibbonTabEntry class One tab of the "ribbon" of a plugin.json: { "id": "tools", "title": "Tools", "panels": [ ... ] }.
CadPluginSetting class One setting a plugin declares with CadSettingAttribute: its label, kind, default and range, as the presenter draws them, and its value, read from and written to the plugin's property.
CadPluginSettingEntry class One setting a Python tool declares in the "settings" of its plugin.json, as a C# plugin declares one with CadSettingAttribute: { "name": "textHeight", "label": "Text height", "kind": "number", "default": 2.5, "minimum": 0.1, "maximum": 1000, "description": "How high the numbers are written." }.
CadPluginSnapEntry class One object snap a Python tool declares in the "snaps" of its plugin.json: { "keyword": "CTOP", "name": "Circle top", "entityTypes": ["CIRCLE"], "glyph": "quadrant", "onByDefault": true }.
CadPropertyProvider delegate What a plugin gives the Properties panel, as the extension's DescribeSelection does: it gets the request and returns what the panel shows, typically the groups it was given and its own besides.
CadPropertyRequest class What a Properties provider is given when the panel is read: the drawing, the objects shown and what the panel shows so far, the presenter's groups and those of the extensions.
CadRibbonButton class A button that starts a command, as a button of the presenter's own ribbon does, or runs a callback of the plugin at once on the window's thread.
CadRibbonItem class What a panel holds: a CadRibbonButton or a CadRibbonSplitButton.
CadRibbonItemSize enum How big an item of a panel is drawn.
CadRibbonPanel class A panel of a ribbon tab: a titled row of items, as AutoCAD's RibbonPanel.
CadRibbonSplitButton class A button with a drop-down of others, as AutoCAD's Circle button is: the part on top runs one button, the arrow lists them all.
CadRibbonTab class A tab of the ribbon a plugin adds, as AutoCAD's RibbonTab: panels of buttons.
CadSettingAttribute class Marks a public property of a plugin's class as a setting the presenter shows and the user changes, as [CadSetting("Text height", Minimum = 0.1)] public double TextHeight { get; set; } = 2.5;.
CadSettingKind enum What kind of value a plugin's setting holds, and so which box the presenter draws for it.
CadSnapFinder delegate Works out the points of a custom snap for the entity under the cursor, in the world coordinates of the space shown; those farther from the cursor than the aperture are dropped.
CadSnapRequest class What a CadSnapFinder is given: the entity under the aperture and where the cursor is.
ICadPluginApplication interface The entry point of a plugin that adds to the window, as AutoCAD's IExtensionApplication is: a public class with a public constructor that takes nothing, which the presenter makes once when the plugin is loaded and ICadPluginApplication.Initializes, so that the plugin adds its ribbon tabs and panels, Properties rows, DRAWINGS buttons and menu items, canvas menu items and object snaps to the CadPluginHost.