Creates a named command that is saved by the environment and made available the next time the environment starts, even if the Add-in is not loaded on environment startup.
Namespace: EnvDTE80
Assembly: EnvDTE80 (in envdte80.dll)
Visual Basic (Declaration)
Function AddNamedCommand2 ( _
<InAttribute> AddInInstance As AddIn, _
<InAttribute> Name As String, _
<InAttribute> ButtonText As String, _
<InAttribute> Tooltip As String, _
<InAttribute> MSOButton As Boolean, _
<InAttribute> <OptionalAttribute> Bitmap As Object, _
<InAttribute> <OptionalAttribute> ByRef ContextUIGUIDs As Object(), _
<InAttribute> <OptionalAttribute> Optional vsCommandStatusValue As Integer = 3, _
<InAttribute> <OptionalAttribute> Optional CommandStyleFlags As Integer = 3, _
<InAttribute> <OptionalAttribute> Optional ControlType As vsCommandControlType = vsCommandControlType.vsCommandControlTypeButton _
) As Command
Dim instance As Commands2
Dim AddInInstance As AddIn
Dim Name As String
Dim ButtonText As String
Dim Tooltip As String
Dim MSOButton As Boolean
Dim Bitmap As Object
Dim ContextUIGUIDs As Object()
Dim vsCommandStatusValue As Integer
Dim CommandStyleFlags As Integer
Dim ControlType As vsCommandControlType
Dim returnValue As Command
returnValue = instance.AddNamedCommand2(AddInInstance, Name, ButtonText, Tooltip, MSOButton, Bitmap, ContextUIGUIDs, vsCommandStatusValue, CommandStyleFlags, ControlType)
Command AddNamedCommand2 (
[InAttribute] AddIn AddInInstance,
[InAttribute] string Name,
[InAttribute] string ButtonText,
[InAttribute] string Tooltip,
[InAttribute] bool MSOButton,
[OptionalAttribute] [InAttribute] Object Bitmap,
[OptionalAttribute] [InAttribute] ref Object[] ContextUIGUIDs,
[OptionalAttribute] [InAttribute] int vsCommandStatusValue,
[OptionalAttribute] [InAttribute] int CommandStyleFlags,
[OptionalAttribute] [InAttribute] vsCommandControlType ControlType
)
Command^ AddNamedCommand2 (
[InAttribute] AddIn^ AddInInstance,
[InAttribute] String^ Name,
[InAttribute] String^ ButtonText,
[InAttribute] String^ Tooltip,
[InAttribute] bool MSOButton,
[InAttribute] [OptionalAttribute] Object^ Bitmap,
[InAttribute] [OptionalAttribute] array<Object^>^% ContextUIGUIDs,
[InAttribute] [OptionalAttribute] int vsCommandStatusValue,
[InAttribute] [OptionalAttribute] int CommandStyleFlags,
[InAttribute] [OptionalAttribute] vsCommandControlType ControlType
)
Command AddNamedCommand2 (
/** @attribute InAttribute() */ AddIn AddInInstance,
/** @attribute InAttribute() */ String Name,
/** @attribute InAttribute() */ String ButtonText,
/** @attribute InAttribute() */ String Tooltip,
/** @attribute InAttribute() */ boolean MSOButton,
/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ Object Bitmap,
/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ /** @ref */ Object[] ContextUIGUIDs,
/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ int vsCommandStatusValue,
/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ int CommandStyleFlags,
/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ vsCommandControlType ControlType
)
JScript does not support passing value-type arguments by reference.
Parameters
- AddInInstance
Required. The AddIn Object is adding the new command.
- Name
Required. The short form of the name for your new command. AddNamedCommand2 uses the preface, Addins.Progid., to create a unique name.
- ButtonText
Required. The name to use if the command is bound to a button that is displayed by name rather than by icon.
- Tooltip
Required. The text displayed when a user hovers the mouse pointer over any control bound to the new command.
- MSOButton
Required. Indicates whether the named command's button picture is an Office picture. True = button. If MSOButton is False, then Bitmap is the ID of a 16x16 bitmap resource (but not an icon resource) in a Visual C++ resource DLL that must reside in a folder with the language's locale identifier (1033 for English).
- Bitmap
Optional. The ID of a bitmap to display on the button.
- ContextUIGUIDs
Optional. A SafeArray of GUIDs that determines which environment contexts (that is, debug mode, design mode, and so on) enable the command. See DisableFlags.
- vsCommandStatusValue
Optional. Determines whether the disabled state of the command is invisible or grey when you supply a ContextUIGUIDs and none are currently active.
- CommandStyleFlags
Value from the vsCommandStyle enumeration. Controls the visual style of any UI added for this command.
- ControlType
Defines the control type added when the UI is created.
Return Value
The named command that was created.