private IVsOutputWindowPane GetOutputPane() { var outputWindow = (IVsOutputWindow)_serviceProvider.GetService(typeof(SVsOutputWindow)); if (outputWindow == null) { return(null); } var guid = _outputPaneGuid; var pane = (IVsOutputWindowPane)null; var hr = outputWindow.GetPane(ref guid, out pane); if (hr != VSConstants.E_FAIL && hr != VSConstants.E_INVALIDARG) { VSInteropHelper.Validate(hr); } if (pane == null) { VSInteropHelper.Validate(outputWindow.CreatePane(ref guid, _outputPaneCaption, 1, 1)); VSInteropHelper.Validate(outputWindow.GetPane(ref guid, out pane)); } VSInteropHelper.Validate(pane.Activate()); return(pane); }
private void ClosePane() { var outputWindow = (IVsOutputWindow)_serviceProvider.GetService(typeof(SVsOutputWindow)); if (outputWindow == null) { return; } var guid = _outputPaneGuid; VSInteropHelper.Validate(outputWindow.DeletePane(ref guid)); }