public async Task InitializeAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            var windowId = guidQuokkaExtensionVS2019PackageIds.QuokkaOutputWindowId;

            OutputWindow.GetPane(ref windowId, out var quokkaPane);
            if (quokkaPane == null)
            {
                OutputWindow.CreatePane(ref windowId, "Quokka", 1, 1);
                OutputWindow.GetPane(ref windowId, out quokkaPane);
                quokkaPane.Activate();
            }
            QuokkaPane = quokkaPane;
        }
        private void WriteToOutputWindow(string message)
        {
            IVsOutputWindowPane outputPane;

            OutputWindow.GetPane(ref _paneGuid, out outputPane);

            if (outputPane == null)
            {
                // Create a new pane if not found
                OutputWindow.CreatePane(ref _paneGuid, EXTENSION_NAME, Convert.ToInt32(true), Convert.ToInt32(false));
            }

            // Retrieve the new pane.
            OutputWindow.GetPane(ref _paneGuid, out outputPane);

            outputPane.OutputStringThreadSafe(string.Format("[{0}]\t{1}", DateTime.Now.ToString("hh:mm:ss tt"), message));
            outputPane.OutputStringThreadSafe(Environment.NewLine);
        }
Пример #3
0
        private static bool EnsurePane()
        {
            ThreadHelper.ThrowIfNotOnUIThread(nameof(EnsurePane));

            if (_outputWindowPane == null)
            {
                if (OutputWindow != null)
                {
                    if (ErrorHandler.Failed(OutputWindow.GetPane(ref _outputPaneGuid, out _outputWindowPane)) &&
                        ErrorHandler.Succeeded(OutputWindow.CreatePane(ref _outputPaneGuid, Resources.Text.OutputWindowTitle, 0, 0)))
                    {
                        if (ErrorHandler.Succeeded(OutputWindow.GetPane(ref _outputPaneGuid, out _outputWindowPane)))
                        {
                            _outputWindowPane.Activate();
                        }
                    }
                }
            }

            return(_outputWindowPane != null);
        }