Commands2.CommandInfo 메서드

지정된 CommandBar 컨트롤에 연결된 명령 GUID 및 ID를 반환합니다.

네임스페이스:  EnvDTE80
어셈블리:  EnvDTE80(EnvDTE80.dll)

구문

‘선언
Sub CommandInfo ( _
    CommandBarControl As Object, _
    <OutAttribute> ByRef Guid As String, _
    <OutAttribute> ByRef ID As Integer _
)
void CommandInfo(
    Object CommandBarControl,
    out string Guid,
    out int ID
)
void CommandInfo(
    [InAttribute] Object^ CommandBarControl, 
    [OutAttribute] String^% Guid, 
    [OutAttribute] int% ID
)
abstract CommandInfo : 
        CommandBarControl:Object * 
        Guid:string byref * 
        ID:int byref -> unit
function CommandInfo(
    CommandBarControl : Object, 
    Guid : String, 
    ID : int
)

매개 변수

  • CommandBarControl
    형식: Object

    필수 요소. 명령과 관련된 CommandBar 컨트롤입니다.

  • Guid
    형식: String%

    필수 요소. 명령의 GUID입니다.

  • ID
    형식: Int32%

    필수 요소. 명령 ID입니다.

예제

Sub CommandInfoExample()
   Dim cmds As Commands
   Dim cmdobj As Command
   Dim cmdbarobj As CommandBar
   Dim cmdbarctl As CommandBarControl
   Dim colAddins As AddIns
   Dim GUID As String
   Dim ID As Long

   ' Set references.
   colAddins = DTE.AddIns()
   cmds = DTE.Commands
   cmdobj = cmds.Item("File.NewFile")
   GUID = ""
   ID = 0

   ' Create a toolbar and add the File.NewFile command to it.
   cmdbarobj = cmds.AddCommandBar("AACmdBar", vsCommandBarType.vsCommandBarTypeToolbar)
   MsgBox("Commandbar name: " & cmdbarobj.Name)
   cmdbarctl = cmdobj.AddControl(cmdbarobj)
   ' Assign new GUID and ID to command bar control.
   cmds.CommandInfo(cmdbarctl, GUID, ID)
End Sub

.NET Framework 보안

참고 항목

참조

Commands2 인터페이스

EnvDTE80 네임스페이스