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); }
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); }