.
Following is the internal documentation for the MadCap plugin API.
Here is what you need before you begin.
Complete the following steps.
Implement the IPlugin interface.
Here is a basic example where the function of the plugin is to simply show a MessageBox whenever the plugin is activated or deactivated.
using System;
using System.Windows.Forms;
using B3.PluginAPIKit;
namespace DemoPlugin
{
public class DemoPlugin : IPlugin
{
private IHost mHost;
private bool mActivated;
public bool IsActivated
{
get { return mActivated; }
}
public string GetVersion()
{
return "1.0";
}
public string GetAuthor()
{
return "Bob Smith";
}
public string GetDescription()
{
return "Displays a message box.";
}
public string GetName()
{
return "DemoPlugin";
}
public void Initialize(IHost host)
{
mHost = host;
}
public void Execute()
{
mActivated = true;
MessageBox.Show(GetName() + " activated!");
}
public void Stop()
{
MessageBox.Show(GetName() + " deactivated!");
mHost.Dispose();
mActivated = false;
}
}
}
Flare monitors the Plugins folder under its root application directory. Any valid plugin it detects inside the Plugins folder will be listed in the Plugins dialog under Options.
Within the Plugins directory, create a new folder named after your plugin. For the example above, the plugin directory is named “DemoPlugin." After creating the folder, add your built plugin assemblies and resource files into that directory. The directory hierarchy should look as follows:
Flare.App
Plugins
DemoPlugin
Plugin Assemblies+ Resource Files
Do the following to enable the plugin for Flare.
Open up the Plugins dialog.
Using the Ribbon interface, this is under File>Options>Plugins.
Using the Toolstrip interface, this is under Tools>Options>Plugins.
In the list of the plugins, locate your plugin and click Enable.
Note: For the plugin to take full effect, an application restart is highly recommended.