Exemplo n.º 1
0
        public KeyPressInterceptor(ViewCreationListener createdView)
        {
            _textViewAdapter = createdView.TextViewAdapter;
            var textNavigator = createdView.TextNavigator.GetTextStructureNavigator(createdView.TextView.TextBuffer);
            _sessionManager = new CompletionSessionManager(createdView.CompletionBroker, createdView.TextView, textNavigator);

            TryChainTheNextCommand();
        }
Exemplo n.º 2
0
        public KeyPressInterceptor(ViewCreationListener createdView)
        {
            _textViewAdapter = createdView.TextViewAdapter;
            var textNavigator = createdView.TextNavigator.GetTextStructureNavigator(createdView.TextView.TextBuffer);

            _sessionManager = new CompletionSessionManager(createdView.CompletionBroker, createdView.TextView, textNavigator);

            TryChainTheNextCommand();
        }
Exemplo n.º 3
0
 public void Setup()
 {
     _listener = new ViewCreationListener();
     _mockAdapterFactoryService = MockRepository.GenerateMock<IVsEditorAdaptersFactoryService>();
     _mockServiceProvider = new MockServiceProvider();
     _mockTextView = MockRepository.GenerateMock<IVsTextView>();
     _listener.AdaptersFactoryService = _mockAdapterFactoryService;
     _listener.ServiceProvider = _mockServiceProvider;
 }
Exemplo n.º 4
0
        public void ListenerShouldAttemptToGetAnInstanceOfTheWpfTextView()
        {
            var listener = new ViewCreationListener();
            var mockAdapterFactoryService = MockRepository.GenerateMock<IVsEditorAdaptersFactoryService>();
            var mockTextView = MockRepository.GenerateMock<IVsTextView>();
            var mockWpfTextView = MockRepository.GenerateMock<IWpfTextView>();
            var mockTextNav = MockRepository.GenerateStub<ITextStructureNavigatorSelectorService>();
            var mockProperties = MockRepository.GenerateStub<PropertyCollection>();
            var mockBuffer = MockRepository.GenerateStub<ITextBuffer>();
            var mockBroker = MockRepository.GenerateStub<ICompletionBroker>();
            var mockTextStructureNav = MockRepository.GenerateStub<ITextStructureNavigator>();

            listener.AdaptersFactoryService = mockAdapterFactoryService;
            listener.TextNavigator = mockTextNav;
            listener.CompletionBroker = mockBroker;
            mockAdapterFactoryService.Expect(x => x.GetWpfTextView(mockTextView)).Return(mockWpfTextView);
            mockWpfTextView.Stub(x => x.Properties).Return(mockProperties);
            mockWpfTextView.Stub(x => x.TextBuffer).Return(mockBuffer);
            mockTextNav.Stub(x => x.GetTextStructureNavigator(mockBuffer)).Return(mockTextStructureNav);

            listener.VsTextViewCreated(mockTextView);

            mockAdapterFactoryService.VerifyAllExpectations();
        }