Click or drag to resize

Command Class

Represents an entry in the main menu or toolbar.
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    System.Runtime.InteropServicesStandardOleMarshalObject
      BaseObject
        Wrapper
          Easymap.AddInCommand

Namespace: Easymap.AddIn
Assembly: EasyMap.AddIn (in EasyMap.AddIn.dll) Version: 12.3.0.0
Syntax
public sealed class Command : Wrapper

The Command type exposes the following members.

Properties
 NameDescription
Public propertyCaption Display caption
Public propertyCommandType The position where the the Command will be displayed in the user interface.
Public propertyImage A 16x16 pixel image which will be displayed next to the command entry.
Public propertyIsChecked Command is checked
Public propertyIsEnabled Command is enabled
Public propertyIsVisible Command is visible
Public propertyShortcutKeys User defined shortcut, which will be refered to the specified command.
Top
Methods
 NameDescription
Public methodDisposeReleases all resources used by the Command
(Overrides Wrapper.Dispose)
Top
Events
 NameDescription
Public eventClick The click handler
Public eventUpdate The update handler is called each time the application decides to update the state of the user interface.
Top
Remarks
Commands can be created using the CreateCommand(CommandType, String) function.
Example
Adding an Command to the Tools-menu
C#
private void AddCommand()
{
    Command cmd = Application.Current.Commands.CreateCommand(CommandType.Tools, "MyMenuEntry");
    cmd.Click += new CommandEventHandler(cmd_Click);

    Application.Current.Commands.Add(cmd);
}

private void cmd_Click(object sender, CommandArgs e)
{
    Document doc = e.Document;
    //Do something
}
See Also