public int GetCodeWindowManager(IVsCodeWindow pCodeWin, out IVsCodeWindowManager ppCodeWinMgr)
            {
                var model = _serviceProvider.GetService(typeof(SComponentModel)) as IComponentModel;
                var service = model.GetService<IVsEditorAdaptersFactoryService>();

                IVsTextView textView;
                if (ErrorHandler.Succeeded(pCodeWin.GetPrimaryView(out textView)))
                {
                    ppCodeWinMgr = new CodeWindowManager(pCodeWin, service.GetWpfTextView(textView));
                    return VSConstants.S_OK;
                }

                ppCodeWinMgr = null;
                return VSConstants.E_FAIL;
            }
Exemplo n.º 2
0
        public int GetCodeWindowManager(IVsCodeWindow pCodeWin, out IVsCodeWindowManager ppCodeWinMgr)
        {
            var model   = _serviceProvider.GetService(typeof(SComponentModel)) as IComponentModel;
            var service = model.GetService <IVsEditorAdaptersFactoryService>();

            IVsTextView textView;

            if (ErrorHandler.Succeeded(pCodeWin.GetPrimaryView(out textView)))
            {
                ppCodeWinMgr = new CodeWindowManager(pCodeWin, service.GetWpfTextView(textView));
                return(VSConstants.S_OK);
            }

            ppCodeWinMgr = null;
            return(VSConstants.E_FAIL);
        }