当前位置: 首页>>代码示例>>C#>>正文


C# IVsCodeWindow.GetBuffer方法代码示例

本文整理汇总了C#中IVsCodeWindow.GetBuffer方法的典型用法代码示例。如果您正苦于以下问题:C# IVsCodeWindow.GetBuffer方法的具体用法?C# IVsCodeWindow.GetBuffer怎么用?C# IVsCodeWindow.GetBuffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVsCodeWindow的用法示例。


在下文中一共展示了IVsCodeWindow.GetBuffer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCodeWindowManager

        public int GetCodeWindowManager(IVsCodeWindow pCodeWin, out IVsCodeWindowManager ppCodeWinMgr)
        {
            var adaptersFactory = _serviceProvider.GetComponentModel().GetService<IVsEditorAdaptersFactoryService>();

            IVsTextLines textLines;
            ErrorHandler.ThrowOnFailure(pCodeWin.GetBuffer(out textLines));
            var textBuffer = adaptersFactory.GetDataBuffer(textLines);
            if (textBuffer == null)
            {
                ppCodeWinMgr = null;
                return VSConstants.E_FAIL;
            }

            ppCodeWinMgr = _serviceProvider.GetHlslToolsService().GetOrCreateCodeWindowManager(pCodeWin);
            return VSConstants.S_OK;
        }
开发者ID:pminiszewski,项目名称:HlslTools,代码行数:16,代码来源:HlslLanguageInfo.cs

示例2:

 int IVsLanguageInfo.GetCodeWindowManager(IVsCodeWindow pCodeWin, out IVsCodeWindowManager ppCodeWinMgr)
 {
     IVsTextLines lines;
     IVsEditorAdaptersFactoryService service = this.ComponentModel.GetService<IVsEditorAdaptersFactoryService>();
     ErrorHandler.ThrowOnFailure(pCodeWin.GetBuffer(out lines));
     IVsTextBuffer bufferAdapter = lines;
     ITextBuffer dataBuffer = service.GetDataBuffer(bufferAdapter);
     if (dataBuffer == null)
     {
         ppCodeWinMgr = null;
         return -2147467259;
     }
     ppCodeWinMgr = this.GetCodeWindowManager(pCodeWin, dataBuffer);
     return 0;
 }
开发者ID:smartmobili,项目名称:parsing,代码行数:15,代码来源:LanguageInfo.cs

示例3: GetCodeWindowManager

        int IVsLanguageInfo.GetCodeWindowManager(IVsCodeWindow pCodeWin, out IVsCodeWindowManager ppCodeWinMgr)
        {
            IVsEditorAdaptersFactoryService adaptersFactory = ComponentModel.GetService<IVsEditorAdaptersFactoryService>();

            IVsTextLines textLines;
            ErrorHandler.ThrowOnFailure(pCodeWin.GetBuffer(out textLines));
            ITextBuffer textBuffer = adaptersFactory.GetDataBuffer(textLines);
            if (textBuffer == null)
            {
                ppCodeWinMgr = null;
                return VSConstants.E_FAIL;
            }

            ppCodeWinMgr = GetCodeWindowManager(pCodeWin, textBuffer);
            return VSConstants.S_OK;
        }
开发者ID:sebandraos,项目名称:LangSvcV2,代码行数:16,代码来源:LanguageInfo.cs

示例4: GetCodeWindowManager

 // GetCodeWindowManager -- this gives us the VsCodeWindow which is what we need to
 // add adornments and so forth.
 /// <include file='doc\LanguageService.uex' path='docs/doc[@for="LanguageService.GetCodeWindowManager"]/*' />
 public int GetCodeWindowManager(IVsCodeWindow codeWindow, out IVsCodeWindowManager mgr) {
     Initialize();
     IVsTextLines buffer = null;
     NativeMethods.ThrowOnFailure(codeWindow.GetBuffer(out buffer));
     mgr = CreateCodeWindowManager(codeWindow, GetOrCreateSource(buffer));
     return NativeMethods.S_OK;
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:10,代码来源:LanguageService.cs

示例5: GetCodeWindowManager

        // GetCodeWindowManager -- this gives us the VsCodeWindow which is what we need to
        // add adornments and so forth.
        /// <include file='doc\LanguageService.uex' path='docs/doc[@for="LanguageService.GetCodeWindowManager"]/*' />
        public int GetCodeWindowManager(IVsCodeWindow codeWindow, out IVsCodeWindowManager mgr)
        {
            //set the inheritKeyBinding guid so that navigation keys work. Do this before deriving class's
            //CreateCodeWindowManager method gets called, so they may override if required
            IOleServiceProvider sp = codeWindow as IOleServiceProvider;
            if (sp != null) {
                ServiceProvider site = new ServiceProvider(sp);
                object window = site.GetService(typeof(IVsWindowFrame).GUID);
                if (window is IVsWindowFrame) {
                    IVsWindowFrame frame = (IVsWindowFrame)window;
                    Guid CMDUIGUID_TextEditor = new Guid(0x8B382828, 0x6202, 0x11d1, 0x88, 0x70, 0x00, 0x00, 0xF8, 0x75, 0x79, 0xD2);
                    NativeMethods.ThrowOnFailure(frame.SetGuidProperty((int)__VSFPROPID.VSFPROPID_InheritKeyBindings, ref CMDUIGUID_TextEditor));
                }
            }

            Initialize();
            IVsTextLines buffer = null;
            NativeMethods.ThrowOnFailure(codeWindow.GetBuffer(out buffer));
            mgr = CreateCodeWindowManager(codeWindow, GetOrCreateSource(buffer));
            return NativeMethods.S_OK;
        }
开发者ID:Graham-Pedersen,项目名称:IronPlot,代码行数:24,代码来源:LanguageService.cs


注:本文中的IVsCodeWindow.GetBuffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。