Presenter for the to-do items explorer.
Наследование: DockableToolwindowPresenter
Пример #1
0
        public RubberduckMenu(VBE vbe, AddIn addIn, IGeneralConfigService configService, IRubberduckParser parser, IActiveCodePaneEditor editor, IInspector inspector)
            : base(vbe, addIn)
        {
            _addIn = addIn;
            _parser = parser;
            _configService = configService;

            var testExplorer = new TestExplorerWindow();
            var testEngine = new TestEngine();
            var testGridViewSort = new GridViewSort<TestExplorerItem>(RubberduckUI.Result, false);
            var testPresenter = new TestExplorerDockablePresenter(vbe, addIn, testExplorer, testEngine, testGridViewSort);
            _testMenu = new TestMenu(vbe, addIn, testExplorer, testPresenter);

            var codeExplorer = new CodeExplorerWindow();
            var codePresenter = new CodeExplorerDockablePresenter(parser, vbe, addIn, codeExplorer);
            codePresenter.RunAllTests += CodePresenterRunAllAllTests;
            codePresenter.RunInspections += codePresenter_RunInspections;
            codePresenter.Rename += codePresenter_Rename;
            codePresenter.FindAllReferences += codePresenter_FindAllReferences;
            codePresenter.FindAllImplementations += codePresenter_FindAllImplementations;
            _codeExplorerMenu = new CodeExplorerMenu(vbe, addIn, codeExplorer, codePresenter);

            var todoSettings = configService.LoadConfiguration().UserSettings.ToDoListSettings;
            var todoExplorer = new ToDoExplorerWindow();
            var todoGridViewSort = new GridViewSort<ToDoItem>(RubberduckUI.Priority, false);
            var todoPresenter = new ToDoExplorerDockablePresenter(parser, todoSettings.ToDoMarkers, vbe, addIn, todoExplorer, todoGridViewSort);
            _todoItemsMenu = new ToDoItemsMenu(vbe, addIn, todoExplorer, todoPresenter);

            var inspectionExplorer = new CodeInspectionsWindow();
            var inspectionGridViewSort = new GridViewSort<CodeInspectionResultGridViewItem>(RubberduckUI.Component, false);
            var inspectionPresenter = new CodeInspectionsDockablePresenter(inspector, vbe, addIn, inspectionExplorer, inspectionGridViewSort);
            _codeInspectionsMenu = new CodeInspectionsMenu(vbe, addIn, inspectionExplorer, inspectionPresenter);

            _refactorMenu = new RefactorMenu(IDE, AddIn, parser, editor);
        }
Пример #2
0
        private void OnShowTaskListButtonClick(CommandBarButton ctrl, ref bool CancelDefault)
        {
            var markers   = _settings.ToDoMarkers;
            var presenter = new ToDoExplorerDockablePresenter(_parser, markers, _vbe, _addIn);

            presenter.Show();
        }
Пример #3
0
        public void TodoPresenter_RefreshUpdatesViewItems()
        {
            var code = @"
Public Sub Bazzer()
    'Todo: Fix the foobarred bazzer.
End Sub";

            var codeModule = RdMockFacotry.CreateCodeModuleMock(code);

            var component = RdMockFacotry.CreateComponentMock("Module1", codeModule.Object, vbext_ComponentType.vbext_ct_StdModule);

            var project = RdMockFacotry.CreateProjectMock("VBAProject", vbext_ProjectProtection.vbext_pp_none);
            
            var componentList = new List<VBComponent>() { component.Object };
            var components = RdMockFacotry.CreateComponentsMock(componentList, project.Object);

            component.SetupGet(c => c.Collection).Returns(components.Object);

            var projectList = new List<VBProject>() {project.Object};

            var projects = RdMockFacotry.CreateProjectsMock(projectList);
            project.SetupGet(p => p.VBComponents).Returns(components.Object);

            _vbe = RdMockFacotry.CreateVbeMock(_windows, projects.Object);

            _view.SetupProperty(v => v.TodoItems);

            var parser = new RubberduckParser();

            var presenter = new ToDoExplorerDockablePresenter(parser, _markers, _vbe.Object, _addin.Object, _view.Object, _gridViewSorter);
          
            //act
            presenter.Refresh();

            //assert
            Assert.AreEqual("Todo: Fix the foobarred bazzer.", _view.Object.TodoItems.First().Description);
        }
Пример #4
0
 public ToDoItemsMenu(VBE vbe, AddIn addIn, IToDoExplorerWindow view, ToDoExplorerDockablePresenter presenter)
     : base(vbe, addIn)
 {
     _userControl = view;
     _presenter   = presenter;
 }
Пример #5
0
 public ToDoItemsMenu(VBE vbe, AddIn addIn, IToDoExplorerWindow view, ToDoExplorerDockablePresenter presenter)
     :base(vbe, addIn)
 {
     _userControl = view;
     _presenter = presenter;
 }