Ejemplo n.º 1
0
        public IOutputWindowPane TryGetPane(string name)
        {
            var olesp = (IOleServiceProvider)GlobalServiceProvider.GetService(typeof(IOleServiceProvider));

            if (olesp == null)
            {
                return(null);
            }

            var outputWindow = olesp.TryGetGlobalService <SVsOutputWindow, IVsOutputWindow>();

            if (outputWindow == null)
            {
                return(null);
            }

            Guid?guid = _outputWindows.GetOrAdd(name, CreateWindowPaneOnMainThread);

            if (!guid.HasValue)
            {
                return(null);
            }

            Guid guidValue             = guid.Value;
            IVsOutputWindowPane vspane = null;

            if (ErrorHandler.Failed(ErrorHandler.CallWithCOMConvention(() => outputWindow.GetPane(ref guidValue, out vspane))))
            {
                return(null);
            }

            IOutputWindowPane pane = new VsOutputWindowPaneAdapter(vspane);

            return(pane);
        }
Ejemplo n.º 2
0
        public IOutputWindowPane TryGetPane(string name)
        {
            var olesp = (IOleServiceProvider)GlobalServiceProvider.GetService(typeof(IOleServiceProvider));
            if (olesp == null)
                return null;

            var outputWindow = olesp.TryGetGlobalService<SVsOutputWindow, IVsOutputWindow>();
            if (outputWindow == null)
                return null;

            Guid? guid = _outputWindows.GetOrAdd(name, CreateWindowPaneOnMainThread);
            if (!guid.HasValue)
                return null;

            Guid guidValue = guid.Value;
            IVsOutputWindowPane vspane = null;
            if (ErrorHandler.Failed(ErrorHandler.CallWithCOMConvention(() => outputWindow.GetPane(ref guidValue, out vspane))))
                return null;

            IOutputWindowPane pane = new VsOutputWindowPaneAdapter(vspane);
            return pane;
        }