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


ICommandPoolEdit Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IC > ICommandPoolEdit Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Controls)  

ICommandPoolEdit Interface

Provides access to members that control the command pool.

Product Availability

Available with ArcGIS Engine.

Description

The ICommandPoolEdit interface is used to manage the collection of commands used by the ToolbarControl, a ToolbarMenu, a ToolbarPalette, or the commands shared between several ToolbarControl's. Use the ICommandPoolEdit interface to add and remove commands in the CommandPool and to call the ICommand::OnCreate method.

Members

Name Description
Method AddCommand Adds the specified command to the command pool. If the command already exists its usage count incremented by 1.
Method AddUID Adds the given UID to the command pool and returns an array of command objects.
Method CallOnCreate Calls the specified command OnCreate method if the Hook is set and OnCreate has not already been called.
Read-only property Hook The object that is passed as a hook to the OnCreate method on the command.
Method Remove Decrements the usage count of the command. If this reaches zero the command is removed from the command pool.
Method RemoveAll Removes all commands from the command pool, regardless of each commands usage count.
Method SetHook Sets the object that is passed as a hook to the OnCreate method on the command.

CoClasses that implement ICommandPoolEdit

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

Remarks

The ICommandPoolEdit methods are normally called by the ToolbarControl, ToolbarMenu and ToolbarPalette objects to mange the command's used by their items. Typically, the Hook property will be set to a ToolbarControl. The ToolbarControl will ensure that the CallOnCreate method is called on the first IToolbarControl::Update, once the IToolbarControl::Buddy property has been set.