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


C# IVsEditorAdaptersFactoryService.GetViewAdapter方法代码示例

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


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

示例1: ConnectController

        public static CommandTargetToOleShim ConnectController(IVsEditorAdaptersFactoryService adapterService, ITextView textView, Controller controller) {
            IVsTextView viewAdapter = adapterService.GetViewAdapter(textView);
            CommandTargetToOleShim oleControllerShim = null;

            // Connect main controller to VS text view filter chain.
            // The chain looks like VS IDE -> language main controller -> Core editor
            // However, IDE wants IOleCommandTarget and core editor, although managed,
            // is represented by OLE command target as well. Since R controller
            // is not specific to VS and does not use OLE, we create OLE-to-managed target shim
            // and managed target-to-OLE shims. 
            if (viewAdapter != null) {
                // Create OLE shim that wraps main controller ICommandTarget and represents
                // it as IOleCommandTarget that is accepted by VS IDE.
                oleControllerShim = new CommandTargetToOleShim(textView, controller);

                IOleCommandTarget nextOleTarget;
                viewAdapter.AddCommandFilter(oleControllerShim, out nextOleTarget);

                // nextOleTarget is typically a core editor wrapped into OLE layer.
                // Create a wrapper that will present OLE target as ICommandTarget to
                // HTML main controller so controller can operate in platform-agnostic way.
                ICommandTarget nextCommandTarget = VsAppShell.Current.TranslateCommandTarget(textView, nextOleTarget);
                controller.ChainedController = nextCommandTarget;
            }
            return oleControllerShim;
        }
开发者ID:Microsoft,项目名称:RTVS,代码行数:26,代码来源:OleControllerChain.cs

示例2: ExpansionClient

 public ExpansionClient(ITextView textView, IVsEditorAdaptersFactoryService adapterFactory, IServiceProvider serviceProvider) {
     _textView = textView;
     _serviceProvider = serviceProvider;
     _view = adapterFactory.GetViewAdapter(textView);
     _lines = (IVsTextLines)adapterFactory.GetBufferAdapter(textView.TextBuffer);
     _expansion = _lines as IVsExpansion;
     if (_expansion == null) {
         throw new ArgumentException("TextBuffer does not support expansions");
     }
 }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:10,代码来源:ExpansionClient.cs

示例3: DataTipTextViewFilter

        private DataTipTextViewFilter(IWpfTextView textView, IVsEditorAdaptersFactoryService adapterService, IVsDebugger debugger) {
            Trace.Assert(textView.TextBuffer.ContentType.IsOfType(RContentTypeDefinition.ContentType));

            _textView = textView;
            _debugger = debugger;

            _vsTextView = adapterService.GetViewAdapter(textView);
            _vsTextView.AddCommandFilter(this, out _nextTarget);
            _vsTextView.GetBuffer(out _vsTextLines);

            textView.Properties.AddProperty(typeof(DataTipTextViewFilter), this);
        }
开发者ID:Microsoft,项目名称:RTVS,代码行数:12,代码来源:DataTipTextViewFilter.cs

示例4: DisconnectController

 public static void DisconnectController(IVsEditorAdaptersFactoryService adapterService, ITextView textView, CommandTargetToOleShim oleControllerShim) {
     IVsTextView viewAdapter = adapterService.GetViewAdapter(textView);
     if (viewAdapter != null) {
         viewAdapter.RemoveCommandFilter(oleControllerShim);
      }
 }
开发者ID:Microsoft,项目名称:RTVS,代码行数:6,代码来源:OleControllerChain.cs

示例5: OnCreate

        protected override void OnCreate()
        {
            _replWindow.Initialize();

            _adapterFactory = _replWindow.ComponentModel.GetService<IVsEditorAdaptersFactoryService>();

            var textView = _replWindow.CurrentView;

            SetDefaultFontSize(_replWindow.ComponentModel, textView);

            // create adapters so VS is happy...
            var serviceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)GetService(typeof(Microsoft.VisualStudio.OLE.Interop.IServiceProvider));

            _view = _adapterFactory.GetViewAdapter(textView);
            _findTarget = _view as IVsFindTarget;

            CurrentView.Closed += OnClose;

            _content = _replWindow.Content;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:20,代码来源:VsReplWindow.cs


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