This document is archived and information here might be outdated.  Recommended version.


ICommandPool Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Controls)  

ICommandPool Interface

Provides access to the contents of the command pool. Note: the ICommandPool interface has been superseded byICommandPool2. Please consider using the more recent version.

Product Availability

Available with ArcGIS Engine.

Description

The ICommandPool interface is used to access the collection of commands used by the ToolbarControl or a ToolbarMenu or ToolbarPalette, or the commands shared between several ToolbarControl's. The ToolbarControl manages its CommandPool itself in order to maintain its command items. If a ToolbarMenu or ToolbarPalette are added to a ToolbarControl they will automatically share the same CommandPool as the ToolbarControl. If a ToolbarMenu or ToolbarPalette are used standalone they will mange their own CommandPool. 

Members

Description
Read-only property Command The command at the given index.
Read-only property Count The number of commands in the command pool.
Method Created Indicates if the commands OnCreate method has been called.
Method Exists Indicates if the given command exists in the command pool.
Method FindByUID Searches the command pool for the given UID. Returns matching command if the UID is found or nothing.
Read-only property UID The UID of the given command. May return nothing.
Read-only property UsageCount The number of items using the given command.

CoClasses that implement ICommandPool

CoClasses and Classes Description
CommandPool A collection of commands used by the ToolbarControl.

Remarks

Use the CommandPool to determine if a particular Command Exists, and to then retrieve its UsageCount, UID and Created properties. The Created property indicates whether the ICommand::OnCreate method has been called. Alternatively, iterate the contents of the CommandPool by using the Count and Command properties or the FindByUID method.

.NET Samples

Editing using a custom form (Code Files: EditorForm) | Share a command pool between ToolbarControls (Code Files: ShareCommandPool) | Feature editing with the control commands (Code Files: FeatureEditing)