Exemplo n.º 1
0
        private void initializeMenues()
        {
            var builder = new MenuBuilder(_applicationObject, _addInInstance);

            builder.AddMenuBar("Aut&oTest.Net");
            builder.CreateMenuItem("MenuBar", "AutoTest.Net", "Feedback Window", "Main feedback window for AutoTest.Net messages", "Global::ctrl+shift+j", 1, "AutoTestNet_FeedbackWindow", false, 1);
            builder.CreateMenuItem("MenuBar", "AutoTest.Net", "Restart Engine", "Restarts the AutoTest.Net engine", null, 2, "AutoTestNet_RestartEngine", true, 0);
            builder.CreateMenuItem("MenuBar", "AutoTest.Net", "Resume Engine", "Resumes the AutoTest.Net engine", null, 3, "AutoTestNet_ResumeEngine", true, 0);
            builder.CreateMenuItem("MenuBar", "AutoTest.Net", "Pause Engine", "Pauses the AutoTest.Net engine", null, 4, "AutoTestNet_PuseEngine");
            builder.CreateMenuItem("MenuBar", "AutoTest.Net", "Build And Test All Projects", "Builds all projects and runs all tests", "Global::ctrl+shift+y,a", 5, "AutoTestNet_BuildAndTestAll", true, 0);
            CommandBarControl ctl;

            if (_applicationObject.Version == "9.0") // Visual Studio 2008
            {
                builder.CreateMenuItem("MenuBar", "AutoTest.Net", "Configuration (Global)", "Modify global configuration", null, 6, "AutoTestNet_ConfigGlobal", true, 0);
                builder.CreateMenuItem("MenuBar", "AutoTest.Net", "Configuration (Solution)", "Modify solution configuration", null, 7, "AutoTestNet_ConfigLocal", false, 0);
            }
            else
            {
                ctl = builder.CreateMenuContainer("MenuBar", "AutoTest.Net", "Configuration", "do fancy stuff", null, 6, true, 0);
                builder.CreateSubMenuItem(ctl, "Configuration (Global)", "Modify global configuration", null, 1, "AutoTestNet_ConfigGlobal");
                builder.CleanupOldSubMenuItemByDeletion(ctl, "Configuration (Local)");
                builder.CreateSubMenuItem(ctl, "Configuration (Solution)", "Modify solution configuration", null, 2, "AutoTestNet_ConfigLocal");
            }

            ctl = builder.CreateMenuContainer("Editor Context Menus", "Code Window", "AutoTest.Net", "AutoTest.Net features", null, 1);
            builder.CreateSubMenuItem(ctl, "Run Test(s)", "Runs all tests in current scope", "Global::ctrl+shift+y,u", 1, "AutoTestNet_RunTestsUnderCursor");
            builder.CreateSubMenuItem(ctl, "Rerun Last Manual Test Run", "Reruns last manual test run", "Global::ctrl+shift+y,e", 2, "AutoTestNet_RerunLastManualTestRun");
            builder.CreateSubMenuItem(ctl, "Debug Test", "Debug test", "Global::ctrl+shift+y,d", 3, "AutoTestNet_DebugTestUnderCursor", true, 0);
            builder.CreateSubMenuItem(ctl, "Rerun Last Debug Session", "Reruns last debug session", "Global::ctrl+shift+y,w", 4, "AutoTestNet_RerunLastDebugSession");

            builder.CreateMenuItem("Project and Solution Context Menus", "Solution", "Run Tests (AT.Net)", "Runs all tests in solution", null, 1, "AutoTestNet_RunSolutionTests", false, 0);
            builder.CreateMenuItem("Project and Solution Context Menus", "Solution Folder", "Run Tests (AT.Net)", "Runs all tests in projects", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Project and Solution Context Menus", "Project", "Run Tests (AT.Net)", "Runs all tests in project", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Project and Solution Context Menus", "Cross Project Multi Solution Folder", "Run Tests (AT.Net)", "Runs all tests in solution folders", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Project and Solution Context Menus", "Cross Project Multi Project", "Run Tests (AT.Net)", "Runs all tests in projects", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Project and Solution Context Menus", "Item", "Run Tests (AT.Net)", "Runs all tests in project item", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Project and Solution Context Menus", "Folder", "Run Tests (AT.Net)", "Runs all tests in project item", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Project and Solution Context Menus", "Cross Project Multi Item", "Run Tests (AT.Net)", "Runs all tests in project items", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Project and Solution Context Menus", "Cross Project Multi Project/Folder", "Run Tests (AT.Net)", "Runs all tests in projects and solution folders", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Class View Context Menus", "Class View Project", "Run Tests (AT.Net)", "Runs all tests in project", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Class View Context Menus", "Class View Item", "Run Tests (AT.Net)", "Runs all tests in member", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Class View Context Menus", "Class View Folder", "Run Tests (AT.Net)", "Runs all tests in folder", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
            builder.CreateMenuItem("Class View Context Menus", "Class View Multi-select", "Run Tests (AT.Net)", "Runs all tests in members", null, 1, "AutoTestNet_RunCodeModelTests", false, 0);
        }