Click or drag to resize

Command Class

Represents an entry in the main menu or toolbar.
Inheritance Hierarchy

Namespace:  Easymap.AddIn
Assembly:  EasyMap.AddIn (in EasyMap.AddIn.dll) Version: 12.0.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 propertyShortcutKeys
User defined shortcut, which will be refered to the specified command.
Top
Methods
  NameDescription
Public methodDispose
Releases 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.
Examples
Adding an Command to the Tools-menu
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