コード例 #1
0
        public ToolWindowPane CreateReplWindow(IReplEvaluator /*!*/ evaluator, IContentType /*!*/ contentType, int id, string /*!*/ title, Guid languageServiceGuid, Guid replGuid)
        {
            var service = (IVsUIShell)ServiceProvider.GlobalProvider.GetService(typeof(SVsUIShell));
            var model   = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));

            var replWindow = new VsReplWindow(model, evaluator, contentType, title, languageServiceGuid, replGuid, id);

            Guid           clsId    = replWindow.ToolClsid;
            Guid           toolType = typeof(VsReplWindow).GUID;
            Guid           empty    = Guid.Empty;
            IVsWindowFrame frame;

            // we don't pass __VSCREATETOOLWIN.CTW_fMultiInstance because multi instance panes are
            // destroyed when closed.  We are really multi instance but we don't want to be closed.  This
            // seems to work fine.
            ErrorHandler.ThrowOnFailure(
                service.CreateToolWindow(
                    (uint)(__VSCREATETOOLWIN.CTW_fInitNew | __VSCREATETOOLWIN.CTW_fForceCreate),
                    (uint)id,
                    replWindow.GetIVsWindowPane(),
                    ref clsId,
                    ref toolType,
                    ref empty,
                    null,
                    title,
                    null,
                    out frame
                    )
                );

            replWindow.Frame = frame;

            replWindow.OnToolBarAdded();
            _windows[id] = replWindow;

            return(replWindow);
        }
コード例 #2
0
ファイル: ReplWindowProvider.cs プロジェクト: TerabyteX/main
        public ToolWindowPane CreateReplWindow(IReplEvaluator/*!*/ evaluator, IContentType/*!*/ contentType, int id, string/*!*/ title, Guid languageServiceGuid, Guid replGuid)
        {
            var service = (IVsUIShell)ServiceProvider.GlobalProvider.GetService(typeof(SVsUIShell));
            var model = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));

            var replWindow = new VsReplWindow(model, evaluator, contentType, title, languageServiceGuid, replGuid, id);

            Guid clsId = replWindow.ToolClsid;
            Guid toolType = typeof(VsReplWindow).GUID;
            Guid empty = Guid.Empty;
            IVsWindowFrame frame;

            // we don't pass __VSCREATETOOLWIN.CTW_fMultiInstance because multi instance panes are
            // destroyed when closed.  We are really multi instance but we don't want to be closed.  This
            // seems to work fine.
            ErrorHandler.ThrowOnFailure(
                service.CreateToolWindow(
                    (uint)(__VSCREATETOOLWIN.CTW_fInitNew | __VSCREATETOOLWIN.CTW_fForceCreate),
                    (uint)id,
                    replWindow.GetIVsWindowPane(),
                    ref clsId,
                    ref toolType,
                    ref empty,
                    null,
                    title,
                    null,
                    out frame
                )
            );

            replWindow.Frame = frame;

            replWindow.OnToolBarAdded();
            _windows[id] = replWindow;

            return replWindow;
        }