This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IC > ICommandPoolEdit Interface > ICommandPoolEdit.AddUID Method (ArcObjects .NET 10.4 SDK) |
Adds the given UID to the command pool and returns an array of command objects.
[Visual Basic .NET] Public Function AddUID ( _ ByVal UID As UID _ ) As IArray
[C#] public IArray AddUID ( UID UID );
[C++]
HRESULT AddUID(
IUID* UID,
IArray** pArray
);
[C++]
Parameters UID [in]
UID is a parameter of type IUID pArray [out, retval]
pArray is a parameter of type IArray
Adds commands to the CommandPool using the specified UID. The method searches the CommandPool for the specified UID. If the UID is found then that commands UsageCount is incremented by 1. If the UID is not found a new command is created and added to the CommandPool with a UsageCount of 1. The command is returned in an array.
If the specified UID is a command that implements the ICommandSubType interface, the method will return an array of all the commands, and if necessary create the command in the CommandPool. Set the IUID::SubType property to a none zero value to add a specific command defined within the ICommandSubType object.
1034 800a040a: The supplied command is invalid
1035 800a040b: The subtype specified for the command (possibly in a UID object) is invalid or out of range
ICommandPoolEdit commandPoolEdit=(ICommandPoolEdit) axToolbarControl1.CommandPool;
UID uID=new UIDClass();
uID.Value="MyCommandSubTypes.MyCommands";
IArray array=commandPoolEdit.AddUID(uID);
for (int i=0; i<= array.Count - 1; i++)
{
ICommand command=(ICommand) array.get_Element(i);
System.Windows.Forms.MessageBox.Show(command.Name);
}
Dim pCommandPoolEdit As ICommandPoolEdit
pCommandPoolEdit=AxToolbarControl1.CommandPool
Dim pUid As New UIDClass
pUid.Value="MyCommandSubTypes.MyCommands"
Dim pArray As IArray, pCommand As ICommand, i As Long
pArray=pCommandPoolEdit.AddUID(pUid)
For i=0 To pArray.Count - 1
pCommand=pArray.Element(i)
System.Windows.Forms.MessageBox.Show(pCommand.Name)
Next i