Пример #1
0
 /// <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;
 }
Пример #2
0
        /// <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);
        }
Пример #3
0
        /// <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);
        }
Пример #4
0
        /// <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 suppressed.
            }
            return(paneDef);
        }
Пример #5
0
        /// <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));
        }