Ejemplo n.º 1
0
        private void saveSettingsButton_Click(object sender, EventArgs e)
        {
            RunOptions editFormRunOptions = new RunOptions(editFormRunOptionsDictionary, editFormBrowserList);

            bool SuccessfullySerializedRunOptionsDictionary = editFormRunOptions.SerializeRunOptionsDictionary( );
            bool SuccessfullySerializedBrowserList          = editFormRunOptions.SerializeRunOptionsBrowserList( );

            if (!SuccessfullySerializedRunOptionsDictionary && !SuccessfullySerializedBrowserList)
            {
                MessageBox.Show("Unable to save either the browser list or the other options");
            }
            else if (!SuccessfullySerializedRunOptionsDictionary)
            {
                MessageBox.Show("Unable to save the general run options");
            }
            else if (!SuccessfullySerializedBrowserList)
            {
                MessageBox.Show("Unable to save the browser list");
            }
            else
            {
                Close( );
            }
        }
Ejemplo n.º 2
0
        public TestRunnerGUI( )
        {
            loadDataHandler = new DataLoadHandlers( );
            ButtonControl buttonControls = new ButtonControl();
            FormControl   formControls   = new FormControl();

            InitializeComponent( );

            testSelectorDropdown.DrawItem += testSelectorDropdown_DrawItem;

            editDropdownButton.MouseEnter   += buttonControls.controlButtons_MouseEnter;
            editDropdownButton.MouseLeave   += buttonControls.controlButtons_MouseLeave;
            editRunOptionsButton.MouseEnter += buttonControls.controlButtons_MouseEnter;
            editRunOptionsButton.MouseLeave += buttonControls.controlButtons_MouseLeave;
            setCurrentTest.MouseEnter       += buttonControls.controlButtons_MouseEnter;
            setCurrentTest.MouseLeave       += buttonControls.controlButtons_MouseLeave;
            selectTestExecutableFromFileExplorer.MouseEnter += buttonControls.controlButtons_MouseEnter;
            selectTestExecutableFromFileExplorer.MouseLeave += buttonControls.controlButtons_MouseLeave;
            runTestButton.MouseEnter  += buttonControls.controlButtons_MouseEnter;
            runTestButton.MouseLeave  += buttonControls.controlButtons_MouseLeave;
            closeButton.MouseEnter    += buttonControls.controlButtons_MouseEnter;
            closeButton.MouseLeave    += buttonControls.controlButtons_MouseLeave;
            minimizeButton.MouseEnter += buttonControls.controlButtons_MouseEnter;
            minimizeButton.MouseLeave += buttonControls.controlButtons_MouseLeave;
            helpButton.MouseEnter     += buttonControls.controlButtons_MouseEnter;
            helpButton.MouseLeave     += buttonControls.controlButtons_MouseLeave;

            this.MouseDown += formControls.form_MouseDown;
            this.MouseMove += formControls.form_MouseMove;
            this.MouseUp   += formControls.form_MouseUp;

            testList = new TestList(testListNamePath);

            testList.DeserializeTestDictionary( );

            foreach (KeyValuePair <string, string> currentDictionaryItem in testList.testListNamePath)
            {
                testListNamePath.Add(currentDictionaryItem.Key, currentDictionaryItem.Value);
            }

            loadDataHandler.LoadInTestListToDropdown(testSelectorDropdown, testListNamePath);

            runOptions = new RunOptions( );

            runOptions.DeserializeRunOptions( );

            testRunnerRunOptionsDictionary = runOptions.runOptionsDictionary;

            runOptions.DeserializeRunOptionsBrowserList( );

            testRunnerBrowserList = runOptions.browserList;

            if (testRunnerBrowserList != null)
            {
                loadDataHandler.PopulateBrowserDropdowns(new List <ComboBox>( )
                {
                    runBrowserSelector
                }, testRunnerBrowserList);
            }

            if (testRunnerRunOptionsDictionary != null)
            {
                loadDataHandler.SetDefaultBrowser(runBrowserSelector, testRunnerRunOptionsDictionary);
                loadDataHandler.SetMaxAndDefaultValueForWorkerInput(workersNumberSetterInput, testRunnerRunOptionsDictionary);
            }

            LinkTestListBuildable linkTestListBuildable = new LinkTestListBuildable( );

            linkTestListBuildable.DeserializeTestDictionary( );

            testLinkedToBuildableDictionary = linkTestListBuildable.testNameBuildableDictionary;
        }