/// <summary> /// Creates an output pane instance using the specified output pane definition and /// IVsOutputWindowPane instance. /// </summary> /// <param name="paneDef">Pane definition instance</param> /// <param name="pane">Physical output window pane</param> /// <remarks> /// This constructor is to be used only by the OutputWindow class. /// </remarks> internal OutputWindowPane(OutputPaneDefinition paneDef, IVsOutputWindowPane pane) { _paneDefinition = paneDef; if (paneDef != null) { _name = paneDef.Name; } _pane = pane; }
/// <summary> /// Creates an output window pane by using the SVsOutputWindow service. /// </summary> /// <param name="paneDef">Pane definition instance.</param> /// <returns>HRESULT indicating the success or failure.</returns> private static int CreateWindowPane(OutputPaneDefinition paneDef) { var paneGuid = paneDef.Guid; return(OutputWindowInstance?.CreatePane( ref paneGuid, paneDef.Name, paneDef.InitiallyVisible ? -1 : 0, paneDef.ClearWithSolution ? -1 : 0) ?? VSConstants.E_FAIL); }
/// <summary> /// Gets an output window pane by using the SVsOutputWindow service. /// </summary> /// <param name="paneDef">Pane definition instance.</param> /// <param name="pane">Pane instance</param> /// <returns>HRESULT indicating the success or failure.</returns> private static int GetWindowPane(OutputPaneDefinition paneDef, out IVsOutputWindowPane pane) { var paneGuid = paneDef.Guid; if (OutputWindowInstance != null) { return(OutputWindowInstance.GetPane(ref paneGuid, out pane)); } pane = null; return(VSConstants.E_FAIL); }
/// <summary> /// Creates a pane definition type instance. /// </summary> /// <param name="type">Pane definition type.</param> /// <returns> /// Pane definition instance. /// </returns> private static OutputPaneDefinition CreatePaneDefinition(Type type) { OutputPaneDefinition paneDef = null; try { paneDef = Activator.CreateInstance(type) as OutputPaneDefinition; } catch (SystemException) { // --- This exception is intentionally supressed. } return(paneDef); }
/// <summary> /// Deletes an output window pane by using the SVsOutputWindow service. /// </summary> /// <param name="paneDef">Pane definition instance.</param> /// <returns>HRESULT indicating the success or failure.</returns> private static int DeleteWindowPane(OutputPaneDefinition paneDef) { var paneGuid = paneDef.Guid; return(OutputWindowInstance.DeletePane(ref paneGuid)); }