A plugin can be launched from one or more places in Author-it. You will need to create a new AddArgs class for each place that you wish the plugin to be launched:
-
Use the ToolbarAddArgs to create a button
-
Use the ContextMenuAddArgs to create a menu item in the object list
-
Use the TextEditorAddArgs to create a menu item in the text editor
-
Use the AitEventAddArgs to start a plugin when the user performs a certain action
Set the launch point properties by creating a new AddArgs class, and then adding it to the proxy. This should be done inside the PluginManager constructor.
C#
// Add plugin button to main form toolbar
AuthoritExtensibility.ToolbarAddArgs buttonArgs = new ToolbarAddArgs();
buttonArgs.PluginName = "My Plugin";
buttonArgs.TargetForm = TargetForm.MainForm;
buttonArgs.TargetGroupName = "Web";
buttonArgs.TargetButtonName = "My \r\nplugin";
buttonArgs.Tooltip = "Click this button to start the plugin";
buttonArgs.IconImage = Images.plugin_image;
buttonArgs.OnClick = clickHandler;
_proxy.AddPluginToToolbar(buttonArgs);
VB
' Add plugin button to main form toolbar
Dim buttonArgs As New ToolbarAddArgs
With buttonArgs
.PluginName = "My Plugin"
.TargetForm = TargetForm.MainForm
.TargetGroupName = "Web"
.TargetButtonName = "My " & vbCrLf & "plugin"
.Tooltip = "Click this button to start the plugin"
.IconImage = My.Resources.plugin_image
.OnClick = AddressOf clickHandler
End With
_proxy.AddPluginToToolbar(buttonArgs)