Commands 인터페이스

업데이트: 2007년 11월

개발 환경에서 Command 개체 형식의 모든 명령을 포함합니다.

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

구문

<GuidAttribute("E6B96CAC-B8C7-40AE-B705-5C81878C4A9E")> _
Public Interface Commands _
    Implements IEnumerable

Dim instance As Commands
[GuidAttribute("E6B96CAC-B8C7-40AE-B705-5C81878C4A9E")]
public interface Commands : IEnumerable
[GuidAttribute(L"E6B96CAC-B8C7-40AE-B705-5C81878C4A9E")]
public interface class Commands : IEnumerable
public interface Commands extends IEnumerable

예제

Imports Microsoft.VisualStudio.CommandBars
Sub CommandsExample()
   ' Before running, you must add a reference to the Office 
   ' typelib to gain access to the CommandBar object.
   Dim cmds As Commands
   Dim cmdobj As Command
   Dim customin, customout As Object
   Dim cmdbarobj As CommandBar
   Dim colAddins As AddIns

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

   ' Execute the File.NewFile command.
   cmds.Raise(cmdobj.Guid, cmdobj.ID, customin, customout)

   ' Create a toolbar and add the File.NewFile command to it.
   cmdobj = cmds.Item("File.NewFile")
   cmdbarobj = cmds.AddCommandBar("Mycmdbar", _
     vsCommandBarType.vsCommandBarTypeToolbar)
   cmdobj.AddControl(cmdbarobj)
   ' Show the command bar and its button.
   cmdbarobj.Visible = True
End Sub

참고 항목

참조

Commands 멤버

EnvDTE 네임스페이스