Table of Contents

Interface ICadPluginApplication

Namespace
OpenCAD2D.Plugins
Assembly
OpenCAD2D.Core.dll

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 Initialize(CadPluginHost)s, 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. Terminate() runs when the plugin is unloaded or reloaded, or the presenter closes.

public interface ICadPluginApplication

Remarks

Every public class of the plugin's assemblies that implements it is made, in ordinal order of its full name, and terminated in the reverse order. A class that also holds [CadCommand] methods or [CadSetting] properties is made once, and the commands and the window additions share the one object. A plugin with an application class and no command is loaded: it adds to the window and nothing to the command line. A plugin that uses these additions states [assembly: CadPluginApi("1.1")], so that an older presenter refuses it with its own words.

Methods

Initialize(CadPluginHost)

Runs once, when the plugin is loaded, before any of its commands: the place to call the host's Add methods. What it adds is read when it returns. An exception it throws keeps the plugin's commands and drops everything it added, with a line in Problems.

Terminate()

Runs once when the plugin is unloaded or reloaded, or the presenter closes, before its commands go: the place to let go of what the plugin holds. An exception it throws is logged and the unload goes on.