Пример #1
0
        private void ViewToolWindow(Type toolWindowPaneType)
        {
            // Get instance number 0 of this tool window. It's single instance so that's the only one.
            // The last flag is set to true so that if the tool window does not exist it will be created.
            ToolWindowPane window = this.package.FindToolWindow(toolWindowPaneType, 0, true);

            if ((window == null) || (window.Frame == null))
            {
                throw new NotSupportedException(Properties.Resources.CannotCreateWindow);
            }

            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #2
0
        private void ShowToolWindow(object sender, EventArgs e)
        {
            ToolWindowPane oWindow = FindToolWindow(typeof(ColorSchemeToolWindow), 0, true);

            if ((oWindow == null) || (oWindow.Frame == null))
            {
                throw new NotSupportedException("Can not create tool window.");
            }

            InitStore( );

            IVsWindowFrame oWindowFrame = ( IVsWindowFrame )oWindow.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(oWindowFrame.Show( ));
        }
Пример #3
0
        public void ShowToolWindow(AnkhToolWindow toolWindow, int id, bool create)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            ToolWindowPane pane = FindToolWindow(GetPaneType(toolWindow), id, create);

            IVsWindowFrame frame = pane.Frame as IVsWindowFrame;

            if (frame == null)
            {
                throw new InvalidOperationException("FindToolWindow failed");
            }
            // Bring the tool window to the front and give it focus
            Marshal.ThrowExceptionForHR(frame.Show());
        }
Пример #4
0
        /// <summary>
        /// This function is called when the user clicks the menu item that shows the
        /// tool window. See the Initialize method to see how the menu item is associated to
        /// this function using the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void ShowToolWindowBuildLog(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = this.FindToolWindow(typeof(BuildLogToolWindow), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException("Cannot create Toolwindow: BuildLog");
            }
            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #5
0
        private void ShowToolWindow(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = FindToolWindow(typeof(JishToolWindow), 0, true);

            if (window == null || window.Frame == null)
            {
                throw new NotSupportedException("Could not create or find the Jish console window.");
            }
            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #6
0
        protected override async Task ExecuteAsync(OleMenuCmdEventArgs e)
        {
            // Create the window with the first free ID.
            for (var i = 0; i < 10; i++)
            {
                ToolWindowPane window = await MultiInstanceWindow.ShowAsync(id : i, create : false);

                if (window == null)
                {
                    await MultiInstanceWindow.ShowAsync(id : i, create : true);

                    break;
                }
            }
        }
        public JiraToolWindowNavigatorViewModel(ToolWindowPane parent)
        {
            this._parent = (JiraToolWindow)parent;

            this._searchHost = parent.SearchHost;

            this._historyNavigator = new HistoryNavigator();

            this._service = JiraPackage.Mcs;

            this._oAuthService = new OAuthService();
            this._basicAuthenticationService = new BasicAuthenticationService();

            InitializeCommands(this._service);
        }
Пример #8
0
        private void ShowToolWindow(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane ToolWindow = UnrealVSPackage.Instance.FindToolWindow(typeof(BatchBuilderToolWindow), 0, true);

            if ((null == ToolWindow) || (null == ToolWindow.Frame))
            {
                throw new NotSupportedException(Resources.ToolWindowCreateError);
            }
            IVsWindowFrame ToolWindowFrame = (IVsWindowFrame)ToolWindow.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(ToolWindowFrame.Show());
        }
 /// <summary>
 /// Shows the tool window when the menu item is clicked.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event args.</param>
 private void Execute(object sender, EventArgs e)
 {
     this.package.JoinableTaskFactory.RunAsync(async delegate
     {
         ToolWindowPane window = await this.package.ShowToolWindowAsync(typeof(IconControls.ActionsToolWindow), 0, true, this.package.DisposalToken);
         if ((null == window) || (null == window.Frame))
         {
             throw new NotSupportedException("Cannot create tool window");
         }
         else
         {
             //(window.Content as ActionsToolWindowControl).Package = package as SimpleStateMachineEditorPackage;
         }
     });
 }
Пример #10
0
        /// <summary>
        /// This function is called when the user clicks the menu item that shows the
        /// tool window. See the Initialize method to see how the menu item is associated to
        /// this function using the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void ShowToolWindow(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = FindToolWindow(typeof(ClipboardHistoryWindow), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException(Resources.CanNotCreateWindow);
            }
            var windowFrame = (IVsWindowFrame)window.Frame;

            ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
 public void CloseAllResourceManagerWindow(Package package)
 {
     foreach (KeyValuePair <string, int> entry in projectIdMap)
     {
         ToolWindowPane window =
             package.FindToolWindow(typeof(ResourceManager), entry.Value, false);
         if ((null == window))
         {
             continue;
         }
         IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
         windowFrame.CloseFrame((int)__FRAMECLOSE.FRAMECLOSE_SaveIfDirty);
     }
     projectIdMap.Clear();
 }
Пример #12
0
        internal void ShowExplorerWindow()
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = this.FindToolWindow(typeof(PSCommandExplorerWindow), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException("");
            }
            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #13
0
        internal void OnSourceOutlinerWindowShow(object sender, EventArgs e)
        {
            ToolWindowPane window = FindToolWindow(typeof(SourceOutlinerToolWindow), 0, true);

            if (window == null || window.Frame == null)
            {
                throw new COMException(Resources.CannotCreateWindow);
            }

            _sourceOutlinerToolWindow = (SourceOutlinerToolWindow)window;

            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #14
0
        /// <summary>
        /// Shows the tool window when the menu item is clicked.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            ToolWindowPane window = this.package.FindToolWindow(typeof(MonitorToolWindow), 0, true);

            if (window?.Frame == null)
            {
                throw new NotSupportedException("Cannot create tool window");
            }

            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #15
0
        public void TestAddToolWindow()
        {
            var expectedResult = new ToolWindowPane {
                Frame = _defaultFrame
            };

            PackageMock.Setup(p => p.FindToolWindow <ToolWindowPane>(false, 0))
            .Returns(() => null);
            PackageMock.Setup(p => p.FindToolWindow <ToolWindowPane>(true, 0))
            .Returns(() => expectedResult);

            var actualResult = ToolWindowCommandUtils.AddToolWindow <ToolWindowPane>();

            Assert.AreEqual(expectedResult, actualResult);
        }
Пример #16
0
        public void ShowToolWindow()
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = VSJenkinsManagerPackage.Instance.FindToolWindow(typeof(JenkinsToolWindow), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException(Resources.CanNotCreateWindow);
            }
            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #17
0
        /// <summary>
        /// Shows the tool window when the menu item is clicked.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            this.package.JoinableTaskFactory.RunAsync(async delegate
            {
                ToolWindowPane window = await this.package.ShowToolWindowAsync(typeof(ToolWindow1), 0, true, this.package.DisposalToken);
                if ((null == window) || (null == window.Frame))
                {
                    throw new NotSupportedException("Cannot create tool window");
                }

                await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
                IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
                Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
            });
        }
Пример #18
0
        /// <summary>
        /// This function is called when the user clicks the menu item that shows the
        /// tool window. See the Initialize method to see how the menu item is associated to
        /// this function using the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void ShowToolWindow(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = this.FindToolWindow(typeof(FireflyComponentBrowser), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new COMException(Resources.CanNotCreateWindow);
            }
            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
        public async Task OpenCodeMetricsPaneAsync()
        {
            await JoinableTaskFactory.SwitchToMainThreadAsync();

            ToolWindowPane window = this.FindToolWindow(typeof(CodeMetricsToolPane), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException("Cannot create tool window");
            }

            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #20
0
        protected async Task ShowSharpenResultsToolWindowAsync()
        {
            ToolWindowPane window = Package.FindToolWindow(typeof(SharpenResultsToolWindow), 0, true);

            if (window?.Frame == null)
            {
                throw new NotSupportedException($"Cannot create the '{typeof(SharpenResultsToolWindow)}' tool window.");
            }

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            var windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #21
0
        public override void MenuCallback(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = Context.PACKAGE.FindToolWindow(typeof(ConsoleWindow), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException(Resources.CanNotCreateWindow);
            }
            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #22
0
        /// <summary>
        /// Shows the tool window when the menu item is clicked.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = this.package.FindToolWindow(typeof(BootstrapImport), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException("Cannot create tool window");
            }

            BootstrapImportControl control = (BootstrapImportControl)window.Content;

            EnvDTE.DTE dte = (EnvDTE.DTE)Package.GetGlobalService(typeof(EnvDTE.DTE));
            if (dte.Solution.Projects.Count > 0)
            {
                EnvDTE.Project project       = dte.Solution.Projects.Item(1);
                EnvDTE.Project activeProject = null;

                foreach (String s in (Array)dte.Solution.SolutionBuild.StartupProjects)
                {
                    foreach (EnvDTE.Project proj in dte.Solution.Projects)
                    {
                        if (s == proj.UniqueName)
                        {
                            activeProject = proj;
                        }
                    }
                }

                if (activeProject != null)
                {
                    project = activeProject;
                }

                string projectPath = Path.GetDirectoryName(project.FileName);
                control.ProjectPath = projectPath + "\\";
            }



            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #23
0
        internal void InitializeToolWindowInternal(float dpiFactor = 0)
        {
            ToolWindowPane window = this.FindToolWindow(typeof(WarningList), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException(Resources.CanNotCreateWindow);
            }
            _validationOutput = (ValidationOutput)window.Window;
            if (dpiFactor != 0)
            {
                _validationOutput.Rescale(dpiFactor);
            }
            _toolWindowFrame = (IVsWindowFrame)window.Frame;
            ShowToolWindow();
        }
        public ToolWindowPane ShowToolWindow()
        {
            ToolWindowPane window = null;

            package.JoinableTaskFactory.RunAsync(async delegate
            {
                window = await package.ShowToolWindowAsync(typeof(OutputToolWindow), 0, true, package.DisposalToken);

                if ((null == window) || (null == window.Frame))
                {
                    throw new NotSupportedException($"Cannot create '{Vsix.Name}' output window");
                }
            });

            return(window);
        }
 private void ToolInitialize()
 {
     try
     {
         _controlSettings = LoadSettings(this);
         ToolWindowPane   toolWindow     = GetToolWindow();
         IPackageContext  packageContext = this;
         ControlViewModel viewModel      = ToolWindow.GetViewModel(toolWindow);
         var buildContext = new BuildContext(packageContext, viewModel.FindProjectItem);
         var tool         = new Tool.Tool(packageContext, buildContext, buildContext, viewModel);
     }
     catch (Exception ex)
     {
         ex.TraceUnknownException();
     }
 }
Пример #26
0
        public static void ShowSettings(Package p)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = p.FindToolWindow(typeof(SpotifyRemoteSettings), 0, true);

            if (null == window || null == window.Frame)
            {
                throw new NotSupportedException("Cannot create tool window");
            }

            var windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
        /// <summary>
        /// The show issues tool window.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        /// <exception>
        /// <cref>NotSupportedException</cref>
        /// </exception>
        private void ShowIssuesToolWindow(object sender, EventArgs e)
        {
            IVsWindowFrame windowFrame;

            using (ToolWindowPane window = this.FindToolWindow(typeof(IssuesToolWindow), 0, true))
            {
                if ((null == window) || (null == window.Frame))
                {
                    throw new NotSupportedException("Window Not Found");
                }

                windowFrame = (IVsWindowFrame)window.Frame;
            }

            ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
        /// <summary>
        /// Shows the tool window when the menu item is clicked.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event args.</param>
        private void ShowToolWindow(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = this.package.FindToolWindow(typeof(DiagramPreviewToolWindow), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException("Cannot create tool window");
            }
            window.Caption = $"PlantUml Preview Window {Global.CurrentFile}";
            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #29
0
        /// <summary>
        /// This function is called when the user clicks the menu item that shows the
        /// tool window. See the Initialize method to see how the menu item is associated to
        /// this function using the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        internal void OnAstToolWindowShow(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = FindToolWindow(typeof(AstToolWindow), 0, true);

            if (window == null || window.Frame == null)
            {
                throw new COMException(Resources.CannotCreateWindow);
            }

            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            ErrorHandler.ThrowOnFailure(windowFrame.Show());
        }
Пример #30
0
        /// <summary>
        /// Side affect is creating the tool window if it doesn't exist yet
        /// </summary>
        /// <returns></returns>
        private IVsWindowFrame GetWindowFrame()
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = _toolWindowFinder.FindToolWindow(typeof(SearchToolWindow), 0, true);

            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException(Resources.CanNotCreateWindow);
            }
            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            _toolWindowFinder.UpdateIndexingFilesList();
            return(windowFrame);
        }