예제 #1
0
        private void OnSvgSuitePathTextChanged(object sender, TextChangedEventArgs e)
        {
            if (!this.IsLoaded)
            {
                return;
            }

            string selectePath = txtSvgSuitePath.Text;

            if (selectePath != null)
            {
                selectePath = selectePath.Trim();
            }
            if (string.IsNullOrWhiteSpace(selectePath) || !Directory.Exists(selectePath))
            {
                btnPathLocate.IsEnabled = false;

                return;
            }

            btnPathLocate.IsEnabled = true;

            if (OptionSettings.IsTestSuiteAvailable(selectePath))
            {
                _isGeneralModified             = true;
                _optionSettings.LocalSuitePath = selectePath;
            }
        }
예제 #2
0
        private void OnTestSuitesSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!this.IsLoaded || _isInitialising || _optionSettings == null)
            {
                return;
            }

            var selectedItem = cboTestSuites.SelectedItem as ComboBoxItem;

            if (selectedItem == null || selectedItem.Tag == null)
            {
                return;
            }
            var testSuite = selectedItem.Tag as SvgTestSuite;

            if (testSuite == null)
            {
                return;
            }
            string localSuitePath = testSuite.LocalSuitePath;

            if (OptionSettings.IsTestSuiteAvailable(localSuitePath) == false)
            {
                PromptDialog dlg = new PromptDialog();
                dlg.Owner          = _mainWindow;
                dlg.OptionSettings = _optionSettings;

                var dialogResult = dlg.ShowDialog();

                if (dialogResult == null || dialogResult.Value == false)
                {
                    return;
                }
            }

            _isInitialising = true;

            txtSvgSuitePath.Text    = _optionSettings.GetPath(testSuite.LocalSuitePath);
            txtSvgSuitePathWeb.Text = testSuite.WebSuitePath;

            _optionSettings.LocalSuitePath = testSuite.LocalSuitePath;
            _optionSettings.WebSuitePath   = testSuite.WebSuitePath;

            testSuite.SetSelected(_optionSettings.TestSuites);

            _isGeneralModified = true;

            _isInitialising = false;
        }