示例#1
0
 private Microsoft.VisualStudio.Text.Editor.IWpfTextView GetTextView()
 {
     Microsoft.VisualStudio.TextManager.Interop.IVsTextManager textManager =
         (Microsoft.VisualStudio.TextManager.Interop.IVsTextManager)serviceProvider.GetService(
             typeof(Microsoft.VisualStudio.TextManager.Interop.SVsTextManager));
     Microsoft.VisualStudio.TextManager.Interop.IVsTextView textView;
     textManager.GetActiveView(1, null, out textView);
     return(GetEditorAdaptersFactoryService().GetWpfTextView(textView));
 }
            public TextBufferEventListener(IComponentModel compModel, IVsTextLines textLines, IVsTextManager textMgr, IVsCodeWindow window)
            {
                _textLines = textLines;
                _compModel = compModel;
                _textMgr = textMgr;
                _window = window;

                var cpc = textLines as IConnectionPointContainer;
                var bufferEventsGuid = typeof(IVsTextBufferDataEvents).GUID;
                cpc.FindConnectionPoint(ref bufferEventsGuid, out _cp);
                _cp.Advise(this, out _cookie);
            }
示例#3
0
            public TextBufferEventListener(IComponentModel compModel, IVsTextLines textLines, IVsTextManager textMgr, IVsCodeWindow window)
            {
                _textLines = textLines;
                _compModel = compModel;
                _textMgr   = textMgr;
                _window    = window;

                var cpc = textLines as IConnectionPointContainer;
                var bufferEventsGuid = typeof(IVsTextBufferDataEvents).GUID;

                cpc.FindConnectionPoint(ref bufferEventsGuid, out _cp);
                _cp.Advise(this, out _cookie);
            }