Inheritance: System.Windows.Forms.UserControl, IDockableUserControl
Exemplo n.º 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);
        }
        /// <summary>
        /// </summary>
        /// <exception cref="InvalidOperationException">Thrown when <see cref="_inspector_Reset"/> is <c>null</c>.</exception>
        /// <param name="inspector"></param>
        /// <param name="vbe"></param>
        /// <param name="addin"></param>
        /// <param name="window"></param>
        public CodeInspectionsDockablePresenter(IInspector inspector, VBE vbe, AddIn addin, CodeInspectionsWindow window, GridViewSort<CodeInspectionResultGridViewItem> gridViewSort)
            :base(vbe, addin, window)
        {
            _inspector = inspector;
            _inspector.IssuesFound += _inspector_IssuesFound;
            _inspector.Reset += _inspector_Reset;
            _inspector.Parsing += _inspector_Parsing;
            _inspector.ParseCompleted += _inspector_ParseCompleted;

            _gridViewSort = gridViewSort;

            Control.RefreshCodeInspections += Control_RefreshCodeInspections;
            Control.NavigateCodeIssue += Control_NavigateCodeIssue;
            Control.QuickFix += Control_QuickFix;
            Control.CopyResults += Control_CopyResultsToClipboard;
            Control.Cancel += Control_Cancel;
            Control.SortColumn += SortColumn;
        }
Exemplo n.º 3
0
        public CodeInspectionsDockablePresenter(IInspector inspector, VBE vbe, AddIn addin, CodeInspectionsWindow window)
            : base(vbe, addin, window)
        {
            _inspector              = inspector;
            _inspector.IssuesFound += OnIssuesFound;
            _inspector.Reset       += OnReset;

            Control.RefreshCodeInspections += OnRefreshCodeInspections;
            Control.NavigateCodeIssue      += OnNavigateCodeIssue;
            Control.QuickFix    += OnQuickFix;
            Control.CopyResults += OnCopyResultsToClipboard;
        }
Exemplo n.º 4
0
        private readonly CodeInspectionsDockablePresenter _presenter; //if presenter goes out of scope, so does it's toolwindow Issue #169

        public CodeInspectionsMenu(VBE vbe, AddIn addIn, CodeInspectionsWindow view, CodeInspectionsDockablePresenter presenter)
            : base(vbe, addIn)
        {
            _window    = view;
            _presenter = presenter;
        }
        private readonly CodeInspectionsDockablePresenter _presenter; //if presenter goes out of scope, so does it's toolwindow Issue #169

        public CodeInspectionsMenu(VBE vbe, AddIn addIn, CodeInspectionsWindow view, CodeInspectionsDockablePresenter presenter)
            :base(vbe, addIn)
        {
            _window = view;
            _presenter = presenter;
        }
Exemplo n.º 6
0
        /// <summary>
        /// </summary>
        /// <exception cref="InvalidOperationException">Thrown when <see cref="_inspector_Reset"/> is <c>null</c>.</exception>
        /// <param name="inspector"></param>
        /// <param name="vbe"></param>
        /// <param name="addin"></param>
        /// <param name="window"></param>
        public CodeInspectionsDockablePresenter(IInspector inspector, VBE vbe, AddIn addin, CodeInspectionsWindow window, GridViewSort <CodeInspectionResultGridViewItem> gridViewSort)
            : base(vbe, addin, window)
        {
            _inspector                 = inspector;
            _inspector.IssuesFound    += _inspector_IssuesFound;
            _inspector.Reset          += _inspector_Reset;
            _inspector.Parsing        += _inspector_Parsing;
            _inspector.ParseCompleted += _inspector_ParseCompleted;

            _gridViewSort = gridViewSort;

            Control.RefreshCodeInspections += Control_RefreshCodeInspections;
            Control.NavigateCodeIssue      += Control_NavigateCodeIssue;
            Control.QuickFix    += Control_QuickFix;
            Control.CopyResults += Control_CopyResultsToClipboard;
            Control.Cancel      += Control_Cancel;
            Control.SortColumn  += SortColumn;
        }