다음을 통해 공유


ToolWindows 인터페이스

업데이트: 2007년 11월

네이티브 형식의 셸 도구 창에 쉽게 액세스할 수 있도록 하여 개체 모델에서 도구 창의 검색 가능성과 사용 가능성을 향상시킵니다.

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

구문

<GuidAttribute("19AC6F68-3019-4D65-8D98-404DFB96B8E2")> _
Public Interface ToolWindows

Dim instance As ToolWindows
[GuidAttribute("19AC6F68-3019-4D65-8D98-404DFB96B8E2")]
public interface ToolWindows
[GuidAttribute(L"19AC6F68-3019-4D65-8D98-404DFB96B8E2")]
public interface class ToolWindows
public interface ToolWindows

설명

멤버 속성을 통해 Visual Studio 도구 창에 액세스할 수 있습니다. GetToolWindow 함수를 사용하여 다른 도구 창을 찾을 수 있습니다.

예제

이 예제에서는 "My output"이라는 출력 창을 추가하여 활성화하고 부모 ToolWindows 개체의 Collection 개체를 통해 도달한 모든 도구 창을 표시합니다. 이 예제를 추가 기능으로 실행하는 방법에 대한 자세한 내용은 방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행을 참조하십시오.

Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    OutputToolWindow(_applicationObject)
End Sub
Public Sub OutputToolWindow(ByVal dte As DTE2)
    Dim myOut As OutputWindow
    myOut = _applicationObject.ToolWindows.OutputWindow
    Dim myPane As OutputWindowPane
    Dim txt As String
    txt = ""
    MsgBox("Creating an output window.")
    myPane = myOut.OutputWindowPanes.Add("My output")
    myPane.Activate()
    MsgBox("Adding some text to the output window...")
    myPane.OutputString("This is the collection of tool windows, _
 reached through the Output Window object:" & vbCr)
    For Each tempWindow As EnvDTE80.Window2 In myOut.Parent.Collection
        txt = txt & (tempWindow.Caption & vbCr)
    Next tempWindow
    MsgBox("Displaying all the tool window captions _
 in the Output window...")
    myPane.OutputString(txt)
End Sub
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OnConnection(object application, 
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    OutputToolWindow(_applicationObject);
}
public void OutputToolWindow(DTE2 dte)
{
    OutputWindow myOut;
    myOut = _applicationObject.ToolWindows.OutputWindow;
    OutputWindowPane myPane;
    String txt = null;
    MessageBox.Show("Creating an output window.");
    myPane = myOut.OutputWindowPanes.Add("My output");
    myPane.Activate();
    MessageBox.Show("Adding some text to the output window...");
    myPane.OutputString("This is the collection of tool
 windows,reached through the Output Window object:" + "\n");
    foreach (EnvDTE80.Window2 tempWindow in myOut.Parent.Collection)
    {
        txt = txt + (tempWindow.Caption + "\n");
    }
    MessageBox.Show("Displaying all the tool window captions 
in the output window...");
    myPane.OutputString(txt);
}

참고 항목

참조

ToolWindows 멤버

EnvDTE80 네임스페이스