다음을 통해 공유


ToolWindow 클래스

파생된 클래스에서 재정의된 경우 도메인별 언어용으로 생성된 디자이너에 도구 창을 나타냅니다.

이 API는 CLS 규격이 아닙니다. 

상속 계층 구조

System.Object
  Microsoft.VisualStudio.Shell.WindowPane
    Microsoft.VisualStudio.Modeling.Shell.ModelingWindowPane
      Microsoft.VisualStudio.Modeling.Shell.ToolWindow
        Microsoft.VisualStudio.Modeling.Shell.ModelExplorerToolWindow

네임스페이스:  Microsoft.VisualStudio.Modeling.Shell
어셈블리:  Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0(Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0.dll)

구문

‘선언
<CLSCompliantAttribute(False)> _
Public MustInherit Class ToolWindow _
    Inherits ModelingWindowPane
[CLSCompliantAttribute(false)]
public abstract class ToolWindow : ModelingWindowPane

ToolWindow 형식에서는 다음과 같은 멤버를 노출합니다.

생성자

  이름 설명
Protected 메서드 ToolWindow ToolWindow 클래스의 새 인스턴스를 초기화합니다.

위쪽

속성

  이름 설명
Public 속성 ActiveInPlaceEditWindow 내부 편집을 위한 활성 창을 가져오거나 설정합니다. (ModelingWindowPane에서 상속됨)
Protected 속성 BitmapIndex 파생된 클래스에서 재정의된 경우 도구 창의 이름 옆에 나타나는 비트맵의 인덱스를 가져옵니다.
Protected 속성 BitmapResource 파생된 클래스에서 재정의된 경우 도구 창의 이름 옆에 나타나는 비트맵의 리소스 ID를 가져옵니다.
Public 속성 Content (WindowPane에서 상속됨)
Public 속성 DocData 메모리의 문서를 가져옵니다.
Protected 속성 EnableUndo 도구 창을 가져오고 실행 취소 명령을 활성화합니다.
Public 속성 Frame 이 창에 해당하는 IVsWindowFrame을 가져옵니다. (ModelingWindowPane에서 상속됨)
Protected 속성 HasSelectableObjects 도구 창을 가져오고 문서가 로드되지 않은 경우 개체 선택 명령을 비활성화합니다. (ModelingWindowPane.HasSelectableObjects을(를) 재정의함)
Protected 속성 HasToolBar 도구 창을 가져오고 여기에 도구 모음이 있어야 하는지 여부를 확인합니다.
Protected 속성 HelpService 도움말 서비스를 가져옵니다. (ModelingWindowPane에서 상속됨)
Protected 속성 InitializationMode (WindowPane에서 상속됨)
Public 속성 MenuService 메뉴 명령 서비스를 가져옵니다. (ModelingWindowPane에서 상속됨)
Public 속성 PrimarySelection 창에서 선택된 기본 요소를 가져옵니다. (ModelingWindowPane에서 상속됨)
Protected 속성 SelectedElements 창에서 선택된 요소를 가져옵니다. (ModelingWindowPane에서 상속됨)
Public 속성 SelectionCount 창에서 선택된 요소의 수를 가져옵니다. (ModelingWindowPane에서 상속됨)
Protected 속성 SelectionHelpService 선택 도움말 서비스를 가져옵니다. (ModelingWindowPane에서 상속됨)
Protected 속성 ServiceProvider 이 창에 대해 로컬인 서비스 공급자를 가져옵니다. (ModelingWindowPane에서 상속됨)
Protected 속성 ToolBarHost 도구 창에서 도구 모음이 나타나는 방식을 결정하는 IVsToolWindowToolbarHost 인터페이스를 가져옵니다.
Protected 속성 ToolWindowFont 도구 창에 사용할 글꼴을 가져옵니다.
Public 속성 Window (WindowPane에서 상속됨)
Public 속성 WindowTitle 도구 창의 제목을 가져옵니다.

위쪽

메서드

  이름 설명
Protected 메서드 CommitPendingEditForCommand 파생된 클래스에서 구현된 경우 명령이 실행되기 전에 보류 중인 편집을 커밋해야 하는지 여부를 지정합니다. (ModelingWindowPane에서 상속됨)
Protected 메서드 CountAllObjects 창에 있는 요소 수를 가져옵니다. (ModelingWindowPane에서 상속됨)
Public 메서드 CountObjects 창 또는 현재 선택 영역의 요소 수를 계산합니다. (ModelingWindowPane에서 상속됨)
Protected 메서드 CountSelectedObjects 현재 선택 영역에 있는 요소 수를 가져옵니다. (ModelingWindowPane에서 상속됨)
Public 메서드 Dispose() (WindowPane에서 상속됨)
Protected 메서드 Dispose(Boolean) ToolWindow 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다. (ModelingWindowPane.Dispose(Boolean)을(를) 재정의함)
Protected 메서드 DoSelectObjects 파생된 클래스에서 구현되는 경우 창에서 요소를 선택합니다. (ModelingWindowPane에서 상속됨)
Public 메서드 Equals 지정한 개체와 현재 개체가 같은지 여부를 확인합니다. (Object에서 상속됨)
Protected 메서드 Finalize 가비지 수집에서 회수하기 전에 개체에서 리소스를 해제하고 다른 정리 작업을 수행할 수 있게 합니다. (Object에서 상속됨)
Protected 메서드 GetAllObjects 창의 모든 요소를 가져옵니다. (ModelingWindowPane에서 상속됨)
Public 메서드 GetComponentSelected 지정된 구성 요소를 선택했는지 여부를 지정합니다. (ModelingWindowPane에서 상속됨)
Public 메서드 GetContainerSelected 지정된 컨테이너를 선택했는지 여부를 지정합니다. (ModelingWindowPane에서 상속됨)
Public 메서드 GetHashCode 기본 해시 함수로 작동합니다. (Object에서 상속됨)
Public 메서드 GetObjects 현재 선택된 요소나 창에서 선택될 수 있는 요소를 가져옵니다. (ModelingWindowPane에서 상속됨)
Public 메서드 GetSelectedComponents 창에서 선택된 구성 요소를 가져옵니다. (ModelingWindowPane에서 상속됨)
Protected 메서드 GetSelectedObjects 창에서 선택된 요소를 가져옵니다. (ModelingWindowPane에서 상속됨)
Protected 메서드 GetService 지정된 형식의 서비스를 가져옵니다.사용자 지정 메뉴 명령 서비스를 반환하려면 이 메서드를 재정의 (ModelingWindowPane에서 상속됨)
Public 메서드 GetSite SetSite 로 설정된 사이트를 가져옵니다. (ModelingWindowPane에서 상속됨)
Public 메서드 GetType 현재 인스턴스의 Type을 가져옵니다. (Object에서 상속됨)
Public 메서드 Hide 창을 숨깁니다. (ModelingWindowPane에서 상속됨)
Protected 메서드 Initialize ToolWindow 클래스의 새 인스턴스를 초기화합니다. (WindowPane.Initialize()을(를) 재정의함)
Public 메서드 LoadUIState (WindowPane에서 상속됨)
Protected 메서드 MemberwiseClone 현재 Object의 단순 복사본을 만듭니다. (Object에서 상속됨)
Protected 메서드 OnAfterToolWindowCreate 생성 후 초기화입니다.
Protected 메서드 OnClose 창이 닫힐 때 바로 가기 메뉴 선택에서 창 개체를 제거합니다. (ModelingWindowPane에서 상속됨)
Protected 메서드 OnCreate 도구 창을 만듭니다. (WindowPane.OnCreate()을(를) 재정의함)
Protected 메서드 OnDocumentWindowChanged 사용자가 문서 창에서 변경한 경우 파생 클래스에 알립니다.
Protected 메서드 OnSelectionChanged 선택 사항이 변경된 후 이벤트 수신기에 알립니다. (ModelingWindowPane에서 상속됨)
Protected 메서드 OnSelectionChanging 선택 사항이 변경되기 전 이벤트 수신기에 알립니다. (ModelingWindowPane에서 상속됨)
Protected 메서드 OnToolWindowCreate 문서 창의 프레임 변경 수신
Protected 메서드 PreProcessMessage 창 메시지를 처리합니다. (ModelingWindowPane에서 상속됨)
Public 메서드 SaveUIState (WindowPane에서 상속됨)
Public 메서드 SelectObjects 창에서 요소를 선택합니다. (ModelingWindowPane에서 상속됨)
Public 메서드 SetSelectedComponents(ICollection) 지정된 구성 요소를 선택 컨테이너에 추가하고 셸에 선택 변경을 알립니다. (ModelingWindowPane에서 상속됨)
Public 메서드 SetSelectedComponents(ICollection, SelectionTypes) 현재 구현되지 않았습니다. (ModelingWindowPane에서 상속됨)
Public 메서드 SetSite 환경에서 창을 초기화합니다. (ModelingWindowPane에서 상속됨)
Public 메서드 Show 창을 표시하고 앞으로 불러온 다음 활성 창으로 만듭니다. (ModelingWindowPane에서 상속됨)
Public 메서드 ShowNoActivate 창을 표시하고 앞으로 불러오지만 활성 창으로 만들지는 않습니다. (ModelingWindowPane에서 상속됨)
Public 메서드 ToString 현재 개체를 나타내는 문자열을 반환합니다. (Object에서 상속됨)

위쪽

이벤트

  이름 설명
Public 이벤트 SelectionChanged 창에서 선택 항목이 변경된 후 발생합니다. (ModelingWindowPane에서 상속됨)
Public 이벤트 SelectionChanging 창에서 선택 항목이 변경되기 전에 발생합니다. (ModelingWindowPane에서 상속됨)

위쪽

명시적 인터페이스 구현

  이름 설명
명시적 인터페이스 구현Private 메서드 IVsWindowPane.ClosePane 사용되지 않습니다. (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsUIElementPane.CloseUIElementPane (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsWindowPane.CreatePaneWindow 사용되지 않습니다. (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsUIElementPane.CreateUIElementPane (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IOleCommandTarget.Exec (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsWindowPane.GetDefaultSize 사용되지 않습니다. (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsUIElementPane.GetDefaultUIElementSize (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IServiceProvider.GetService (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsUIElementPane.LoadUIElementState (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsWindowPane.LoadViewState 사용되지 않습니다. (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IOleCommandTarget.QueryStatus (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsUIElementPane.SaveUIElementState (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsWindowPane.SaveViewState 사용되지 않습니다. (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsWindowPane.SetSite 사용되지 않습니다. (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsUIElementPane.SetUIElementSite (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsWindowPane.TranslateAccelerator 사용되지 않습니다. (WindowPane에서 상속됨)
명시적 인터페이스 구현Private 메서드 IVsUIElementPane.TranslateUIElementAccelerator (WindowPane에서 상속됨)

위쪽

설명

도구 창이 생성 된 디자이너에 추가할 수 있습니다, 창을 등록 해야 합니다. 자세한 내용은 ModelingPackage을 참조하십시오.

예제

다음 예제에서는 호출 하는 도구 창이 추가 사용자 지정 도구 창 RegisterTools 라는 도메인 관련 언어 프로젝트. 디자이너에서 생성 된 프로젝트를 열 때에이 창에 대 한 탭 옆에 나타납니다 솔루션 탐색기. 이 탭을 클릭 하면 해당 레이블을 읽고 이 사용자 지정 도구 창을 도구 창의 가운데에 나타납니다.

이 코드는 도구 창을 등록합니다.

using VSShellInterop = Microsoft.VisualStudio.Shell.Interop;
using VSShell = Microsoft.VisualStudio.Shell;
using DslShell = Microsoft.VisualStudio.Modeling.Shell;
using DslDesign = Microsoft.VisualStudio.Modeling.Design;
using VSTextTemplatingHost = Microsoft.VisualStudio.TextTemplating.VSHost;

namespace MS.RegisterTools.DslPackage
{
    [VSShell::ProvideToolWindowVisibility(typeof(CustomToolWindow), 
              Constants.RegisterToolsEditorFactoryId)]
    [VSShell::ProvideToolWindow(typeof(CustomToolWindow), 
              MultiInstances = false, 
              Style = VSShell::VsDockStyle.Tabbed, 
              Orientation = VSShell::ToolWindowOrientation.Right, 
              Window = "{3AE79031-E1BC-11D0-8F78-00A0C9110057}")]

    internal partial class RegisterToolsPackage
    {
        //Initializes the base class for the package
        protected override void Initialize()
        {
            base.Initialize();

            //Registers the custom tool window
            this.AddToolWindow(typeof(CustomToolWindow));
        }
    }
}

이 코드는 도구 창을 정의합니다.

using System;
using System.Windows.Forms;
using VSShellInterop = Microsoft.VisualStudio.Shell.Interop;
using VSShell = Microsoft.VisualStudio.Shell;
using DslShell = Microsoft.VisualStudio.Modeling.Shell;
using DslDesign = Microsoft.VisualStudio.Modeling.Design;
using VSTextTemplatingHost = Microsoft.VisualStudio.TextTemplating.VSHost;

namespace MS.RegisterTools.DslPackage
{

    //Creates a tool window and gives it a title, icon, and label
    internal class CustomToolWindow : DslShell.ToolWindow
    {

        //defines a label
  private Label myLabel;
        
        //creates the tool window
  public CustomToolWindow(IServiceProvider serviceProvider) : base(serviceProvider)
  { 
  }

        //gets the icon for the tool window
        protected override int BitmapResource
        {
            get { return 104; }
        }

        //gets the index for the icon
        protected override int BitmapIndex
        {
            get { return 0; }
        }

        //gets the name of the tool window
        public override string WindowTitle
        {
            get { return "Custom Window"; }
        }

        //sets up a label
  protected override void OnToolWindowCreate()
  {
      this.myLabel = new Label();
this.myLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.myLabel.Text = "This is the custom tool window";
   }

        //puts a label on the tool window
  public override System.Windows.Forms.IWin32Window Window
  {
       get { return this.myLabel; }
  }
    }
}

스레드로부터의 안전성

이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

참고 항목

참조

Microsoft.VisualStudio.Modeling.Shell 네임스페이스