Ejemplo n.º 1
0
        internal CompletionCommandHandler(IVsTextView textViewAdapter, ITextView textView,
            CompletionHandlerProvider provider)
        {
            this._textView = textView;
            this._provider = provider;

            //add the command to the command chain
            textViewAdapter.AddCommandFilter(this, out _nextCommandHandler);
            var nextProp = _nextCommandHandler.GetType().GetProperty("Next");
            var filterObjectProp = _nextCommandHandler.GetType().GetProperty("FilterObject");

            _realCommandHandler =
                (IOleCommandTarget)
                    filterObjectProp.GetValue(nextProp.GetValue(nextProp.GetValue(_nextCommandHandler)));
            textView.Properties[typeof (CompletionCommandHandler)] = this;
        }
Ejemplo n.º 2
0
        internal CompletionCommandHandler(IVsTextView textViewAdapter, ITextView textView,
                                          CompletionHandlerProvider provider)
        {
            this._textView = textView;
            this._provider = provider;

            //add the command to the command chain
            textViewAdapter.AddCommandFilter(this, out _nextCommandHandler);
            var nextProp         = _nextCommandHandler.GetType().GetProperty("Next");
            var filterObjectProp = _nextCommandHandler.GetType().GetProperty("FilterObject");

            _realCommandHandler =
                (IOleCommandTarget)
                filterObjectProp.GetValue(nextProp.GetValue(nextProp.GetValue(_nextCommandHandler)));
            textView.Properties[typeof(CompletionCommandHandler)] = this;
        }