ArcFM Engine Developer Guide
CommandManager Class
Members 


Product Availability
Required Licenses
.NET Assembly
Manages the main menu and toolbars and all commands thereon.
Syntax
'Declaration
 
Public Class CommandManager 
'Usage
 
Dim instance As CommandManager
public class CommandManager 
Remarks
This class provides the capability to define the main menu and toolbars for this application. In order for the toolbars to be dockable at different locations (top, left, right, bottom), the Infragistics toolbar system requires that an Infragistics UltraToolbarsManager object and four UltraToolbarsDockArea windows be defined. This class hides these objects so that the programmer does not need to be concerned about support for these objects. The main menu and the dockable toolbars of this application are defined as CommandBar objects. This CommandManager class keeps a list (collection) of all of the currently defined CommandBars for the application. This list can then be used to save the current configuration of the main menu and toolbars of the application when the program is terminated so that the same configuration can be rebuilt when the application is next started.

The main menu and dockable toolbars are composed of Command objects. There are a number of different types of built-in Command objects. These objects are derived from the abstract Command class. This CommandManager class keeps a list (collection) of all of the currently defined Command objects for the application (known as root tools). This list provides a means for the user to select/edit which commands he desires to be part of which toolbar or the main menu. It also provides a means of storing and restoring the command configuration.

Thus, there are only two public properties which this class provides:

  1. A CommandCollection of all Commands.
  2. A CommandBarCollection of all CommandBars.
The CommandManager provides the means to create, display, and manage the main menu, toolbars, and context menus of the application. During program initialization, any application extension class which has the custom attribute [FrameworkCommand] will be instantiated to create the various commands (popup menus, buttons, etc.) defined for the application. Similarly, any application extension class which as the custom attribute [FrameworkCommandBar] will be instantiated to create the various command bars (main menu, toolbars, and context menus) of the application.

Example

Find and execute a Miner.Windows.Commands.Command that is loaded in a Miner.Windows based application like ArcFM Viewer for ArcGIS Engine or Designer Staker. The command used in this sample implements ICommand and is wrapped in a Miner.Windows.ArcGIS.MapCommand when it is loaded into the application.

Command cmdSaveSession = MainApp.MainWin.CommandManager.Commands["SaveSessionCommand"];
if (cmdSaveSession != null)
{
    cmdSaveSession.Execute();
}

 

Find and execute a Miner.Windows.Commands.StateButtonCommand that is loaded in a Miner.Windows based application (e.g., ArcFM Viewer for ArcGIS Engine or Designer Staker). The command used in this sample implements ITool and is wrapped in a Miner.Windows.ArcGIS.MapCommand when it is loaded into the application.

Command cmdSelectFeature = MainApp.MainWin.CommandManager.Commands["SelectFeaturesTool"];
if (cmdSelectFeature != null)
{
    StateButtonCommand stateCommand = cmdSelectFeature as StateButtonCommand;
    stateCommand.Checked = true;
}
Inheritance Hierarchy

System.Object
   Miner.Windows.Commands.CommandManager

Requirements

Target Platforms: Windows XP SP3 (32-bit and 64-bit), Windows 7 (32-bit and 64-bit)

Not all Operating Systems are supported on all products. Visit the ArcFM Solution Supported Versions page for full details.

See Also

Reference

CommandManager Members
Miner.Windows.Commands Namespace

 

 


Send Comment