/// <summary> /// Helper method for creating and hooking up a <c>TextBufferDataEventsSink</c>. /// </summary> public static void HookupHandler(IVsTextBuffer textBuffer, Action onDocumentLoadCompleted) { var eventHandler = new TextBufferDataEventsSink(onDocumentLoadCompleted); eventHandler._sink = ComEventSink.Advise <IVsTextBufferDataEvents>(textBuffer, eventHandler); }
/// <summary> /// Helper method for creating and hooking up a <c>TextBufferDataEventsSink</c>. /// </summary> public static void HookupHandler(DocumentProvider documentProvider, IVsTextBuffer textBuffer, DocumentKey documentKey) { var eventHandler = new TextBufferDataEventsSink(documentProvider, textBuffer, documentKey); eventHandler._sink = ComEventSink.Advise <IVsTextBufferDataEvents>(textBuffer, eventHandler); }