Command Function

This function is called when a user selects one of the entries in your plug-in's library window menu. If the user has a library entry selected when this function is called, HotDocs passes information about the selected entry to this function so your plug-in can perform an action based on the selected entry as needed.

Syntax

void Command(string libraryPath, HotDocs.LibraryEntity caretEntry, int commandId)

Parameters Description
libraryPath The file path for the open library.
caretEntry The currently selected library entry.
commandId An identifier for the command, which your plug-in can use to determine which command was selected. (This is the same as commandId in GetMenuEntry.)

Example (Visual C#)

The following Visual C# example implements the Command function.

public void Command(string libraryPath, LibraryEntity caretEntry, int commandId)
{
    if (commandId == cmd1)
        System.Diagnostics.Process.Start("http://www.hotdocs.com");
    if (commandId == cmd2)
        MessageBox.Show("Menu sample w/icon selected");
}