Command 인터페이스

업데이트: 2007년 11월

환경의 명령을 나타냅니다.

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

구문

<GuidAttribute("5FE10FB0-91A1-4E55-BAAA-ECCAE5CCEB94")> _
Public Interface Command

Dim instance As Command
[GuidAttribute("5FE10FB0-91A1-4E55-BAAA-ECCAE5CCEB94")]
public interface Command
[GuidAttribute(L"5FE10FB0-91A1-4E55-BAAA-ECCAE5CCEB94")]
public interface class Command
public interface Command

설명

Item를 사용하여 이 개체를 참조합니다.

정식 이름 또는 GUID ID를 사용하는 것과 같이 다양한 방법으로 이 개체를 참조할 수 있습니다. 대부분의 명령을 호출하는 가장 쉬운 방법은 ExecuteCommand를 사용하는 것입니다. 매우 드문 경우이지만 이름 없이 명령을 호출해야 할 경우에는 Raise를 사용합니다

예제

' Macro code.
Sub CommandExample()
  ' Creates a text document listing all command names.
  Dim Cmd As Command
  Dim Doc As Document
  Dim TxtDoc As TextDocument

  ' Create a new text document.
  DTE.ItemOperations.NewFile ("General\Text File")
  Set Doc = ActiveDocument
  Set TxtDoc = Doc.Object("TextDocument")
  For Each Cmd In Commands
  If (Cmd.Name <> "") Then
    TxtDoc.Selection.Text = Cmd.Name & vbLF
    TxtDoc.Selection.Collapse
  End If
  Next
End Sub

참고 항목

참조

Command 멤버

EnvDTE 네임스페이스