Beispiel #1
0
        /*
         * CreateToolWindow
         */

        private Window CreateToolWindow(AddIn addIn, Type toolWindowType, string toolWindowCaption)
        {
            Debug.Assert(addIn != null, "addIn != null");
            Debug.Assert(toolWindowType != null, "toolWindowType != null");

            Window toolWindow = null;

            object   controlObject = null;
            Windows2 toolWindows   = (Windows2)_applicationObject.Windows;

            toolWindow = toolWindows.CreateToolWindow2(
                addIn,
                Assembly.GetExecutingAssembly().Location,
                toolWindowType.FullName,
                toolWindowCaption,
                "{7ED46EA6-8E0D-4116-ABFE-0EEED142BF1E}",
                ref controlObject
                );

            Debug.Assert(toolWindow != null, "toolWindow != null");
            Debug.Assert(controlObject is NuGenTaskListUI, "controlObject is NuGenTaskListUI");

            _taskListUI       = (NuGenTaskListUI)controlObject;
            _taskListUI.DTE   = _applicationObject;
            _taskListUI.Load += _TaskListUI_Load;

            toolWindow.SetTabPicture(Resources.ToolWindow_TaskList.GetHbitmap());

            /* It is necessary to set the value of the Visible property to true; otherwise,
             * exceptions are thrown.
             */
            toolWindow.Visible = true;

            toolWindow.Width  = 250;
            toolWindow.Height = 200;

            return(toolWindow);
        }
		/*
		 * CreateToolWindow
		 */

		private Window CreateToolWindow(AddIn addIn, Type toolWindowType, string toolWindowCaption)
		{
			Debug.Assert(addIn != null, "addIn != null");
			Debug.Assert(toolWindowType != null, "toolWindowType != null");

			Window toolWindow = null;

			object controlObject = null;
			Windows2 toolWindows = (Windows2)_applicationObject.Windows;

			toolWindow = toolWindows.CreateToolWindow2(
				addIn,
				Assembly.GetExecutingAssembly().Location,
				toolWindowType.FullName,
				toolWindowCaption,
				"{7ED46EA6-8E0D-4116-ABFE-0EEED142BF1E}",
				ref controlObject
			);

			Debug.Assert(toolWindow != null, "toolWindow != null");
			Debug.Assert(controlObject is NuGenTaskListUI, "controlObject is NuGenTaskListUI");

			_taskListUI = (NuGenTaskListUI)controlObject;
			_taskListUI.DTE = _applicationObject;
			_taskListUI.Load += _TaskListUI_Load;

			toolWindow.SetTabPicture(Resources.ToolWindow_TaskList.GetHbitmap());

			/* It is necessary to set the value of the Visible property to true; otherwise,
			 * exceptions are thrown.
			 */
			toolWindow.Visible = true;

			toolWindow.Width = 250;
			toolWindow.Height = 200;

			return toolWindow;
		}