There are a number of reasons why writing a MindManager Add-in can be useful. Most obvious is the desire for intimate control over user interaction, and the ability to manipulate some external system using map data as a guide.
Creating an Add-in begins with the IDTExtensibility2 interface. MindManager loosely follows the same Add-In model seen in Microsoft Office and the Visual Studio 2005 IDE. Like those applications, MindManager 7, given the correct registry settings, will load a COM object and obtain an IDTExtensibility interface to that instance. There are 5 methods on this interface. These have an event handler feel to them, used to manage the lifecycle of the Add-in component.
But like most extension efforts, the depth of functionality in an Add-in depends in part on both the MindManager object model and the developer's familiarity with the application itself. MindManager knowledge is built by using the application, but the object model is what it is. One way to deal with it is to learn what it can do.
In this spirit, I wrote a MindManager Add-in Sample. In one form or another, this code has been on my drive for months. This has been a form of sandbox, allowing experimentation with MindManager without cluttering up other projects. The release of MindManager 7 kicked this sample into a corner for a while, but I eventually revisited the subject. After a number of "gee, I should finish this" moments, I finally cleaned it up and added enough documentation to make it intelligable.
This sample factors common behaviors into a utility DLL and implements a sample add-in using these utilities. I tried to exercise the range of UI integration mechanisms available. The list below illustrates the current crop. Remember, most of this is illustrative in nature.
- Ribbon Tabs, Groups - add one Tab to the Fluent UI ribbon, and place a group on that tab
- Menu Commands - add one sample menu item to each stock MindManager menu. Note how the MindManger 7 host handles the deprecated menu identifiers.
- CommandBar Buttons - add a sample button to each command bar made available by the MindManager host. Note how the MindManger 7 host handles the deprecated command bar identifiers.
- Add-in Defined Command Bar - add a custom CommandBar with a button and a menu to the MindManager user interface. Note how the MindManger 7 host handles the deprecated command bar UI widget.
- Add-in Defined Menu - create a menu instance and cache it for later tear-down.
- Event Handlers - create SaveEventHandler and ViewChangeEventHandler instances to catch specific events fired by the host.
- Sample Task Pane - load an icon for the taskpane, then create a sample TaskPane instance
- Sample Option Pane - create an OptionPane instance.
- Sample Business Type - register a URI and create an associated MmxSampleBusinessType instance for it.
- Sample Control Strip - load an Icon, register the MmxSampleControlStrip type with MindManager, create a reference to the DocumentStatsCommand, and populate a context menu for the ControlStrip.
For example, this sample adds a menu item to all the available MindManager dynamic menus, including those deprecated in MindManager 7. The main UI behavior I was unable to demonstrate was the popup KeyTips in the Ribbon. While the ribbon tab created by the add-in responds to the ALT+S key, the individual menu items in the group are not available through the keyboard. I don't know why.
Since the Downloads section of this site doesn't have a distinct Add-in section, I attached the sample to this blog post as a .ZIP archive. This archive file includes the Add-in VS.Net 2005 solution containing three projects: MmxSample, Mmx Utility, and an installation. The source code for the project is included, as is a .CHM documentation file generated from the XML tags using the Microsoft SandCastle tools. The most excellent SandCastle Help File Builder was very useful in generating the docs.
The simplest thing to do with this sample is to download the zip file, expand it to a working directory, and open the solution with VS.Net 2005. The help file for the sample, Mm7Sample.chm, can be found in the MmxSample\collateral\Help folder. As time, energy and reader intrest permits, I may write additional posts discussing the details.
In any event, here's something I wish I had when I first looked at the MindManager object model - a working MindManager Add-in sample.