Command.Guid 속성

지정된 개체의 GUID를 가져옵니다.

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

구문

‘선언
ReadOnly Property Guid As String
string Guid { get; }
property String^ Guid {
    String^ get ();
}
abstract Guid : string
function get Guid () : String

속성 값

형식: System.String
명령을 나타내는 데 사용된 명령 그룹 GUID를 나타내는 문자열입니다.

예제

Sub GuidExample(ByVal dte As DTE2)

    ' Create a new text document.
    Dim win As Window = dte.ItemOperations.NewFile()
    Dim textWin As TextWindow = CType(win.Object, TextWindow)

    ' Split the text document window.
    Dim cmd As Command = dte.Commands.Item("Window.Split")
    dte.Commands.Raise(cmd.Guid, cmd.ID, Nothing, Nothing)

    If MsgBox("Activate the top pane?", MsgBoxStyle.YesNo) = _
        MsgBoxResult.Yes Then

        ' In a split window, the top pane is always at index 2 of the 
        ' Panes collection.
        textWin.Panes.Item(2).Activate()
    Else
        textWin.Panes.Item(1).Activate()
    End If

End Sub
public void GuidExample(DTE2 dte)
{
    // Create a new text document.
    Window win = dte.ItemOperations.NewFile(@"General\Text File", "", 
        Constants.vsViewKindPrimary);
    TextWindow textWin = (TextWindow)win.Object;

    // Split the text document window.
    Command cmd = dte.Commands.Item("Window.Split", -1);
    object dummy = new object();
    dte.Commands.Raise(cmd.Guid, cmd.ID, ref dummy, ref dummy);

    if (MessageBox.Show("Activate the top pane?", "", 
        MessageBoxButtons.YesNo) == DialogResult.Yes)
    {
        // In a split window, the top pane is always at index 2 of the 
        // Panes collection.
        textWin.Panes.Item(2).Activate();
    }
    else
    {
        textWin.Panes.Item(1).Activate();
    }
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Command 인터페이스

EnvDTE 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행