public TextBufferEventListener(IComponentModel componentModel, IVsTextLines textLines)
            {
                this._componentModel = componentModel;
                this._textLines      = textLines;

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

                connectionPointContainer.FindConnectionPoint(ref bufferEventsGuid, out _connectionPoint);
                _connectionPoint.Advise(this, out _cookie);
            }
            public TextBufferEventListener(IComponentModel componentModel, IVsTextLines textLines, Guid languageServiceId)
            {
                _componentModel    = componentModel;
                _textLines         = textLines;
                _languageServiceId = languageServiceId;

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

                connectionPointContainer.FindConnectionPoint(ref bufferEventsGuid, out _connectionPoint);
                _connectionPoint.Advise(this, out _cookie);
            }
Example #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);
            }