Exemple #1
0
        /// <summary>
        /// Get reference to IVsOutputWindowPane interface from pane guid. The method will create the pane if it is not already created.
        /// </summary>
        /// <param name="guidPane">A guid for the pane.</param>
        /// <param name="paneName">The name of the pane.</param>
        /// <param name="visible">Set the visibility state of the pane.</param>
        /// <param name="clearWithSolution">Should the pane be cleared with solution. It is used if the pane will be created by this method.</param>
        /// <returns>A reference to an IVsOutputWindowPane interface.</returns>
        public static IVsOutputWindowPane GetOutputWindowpane(IServiceProvider serviceProvider, Guid guidPane, string paneName, bool visible, bool clearWithSolution)
        {
            IVsOutputWindow outputWindow = serviceProvider.GetService(typeof(IVsOutputWindow)) as IVsOutputWindow;

            if (outputWindow == null)
            {
                throw new InvalidOperationException("Could not get the IVsOutputWindow");
            }

            IVsOutputWindowPane outputWindowPane = null;
            int hr = outputWindow.GetPane(ref guidPane, out outputWindowPane);

            if (ErrorHandler.Failed(hr) && outputWindowPane == null)
            {
                if (ErrorHandler.Succeeded(outputWindow.CreatePane(ref guidPane, paneName, visible ? 1 : 0, clearWithSolution ? 1 : 0)))
                {
                    outputWindow.GetPane(ref guidPane, out outputWindowPane);
                }
            }
            else
            {
                if (!visible)
                {
                    outputWindowPane.Hide();
                }
                else
                {
                    outputWindowPane.Activate();
                }
            }

            return(outputWindowPane);
        }
Exemple #2
0
 /// <summary>
 /// Hides this output window pane, undisplays it in the output window.
 /// </summary>
 public void Hide()
 {
     if (IsVirtual)
     {
         return;
     }
     _pane.Hide();
 }
Exemple #3
0
        /// <summary>
        /// Hides the pane
        /// </summary>
        public void Hide()
        {
            if (pane == null)
            {
                return;
            }
            int hr = pane.Hide();

            Marshal.ThrowExceptionForHR(hr);
        }
Exemple #4
0
        public int Hide()
        {
            var result = target.Hide();

            if (ErrorHandler.Failed(result))
            {
                throw new Win32Exception(result);
            }

            return(result);
        }
Exemple #5
0
        public async Task DisposeAsync()
        {
            await this.JoinableTaskFactory.SwitchToMainThreadAsync(this.DisposalToken);

            IVsRunningDocumentTable rdt = (IVsRunningDocumentTable)(await GetServiceAsync(typeof(SVsRunningDocumentTable)));

            rdt.UnadviseRunningDocTableEvents(_rdtCookie);

            if (_outputPane != null)
            {
                _outputPane?.Hide();
                IVsOutputWindow output = (IVsOutputWindow)GetService(typeof(SVsOutputWindow));
                output.DeletePane(ref _paneGuid);
            }
        }
Exemple #6
0
 public void Dispose()
 {
     _outputPane.Hide();
     _outputPane.Clear();
     _outputPane = null;
 }