private void OnGeneralSettingsChanged(object sender, RoutedEventArgs e) { if (!this.IsLoaded) { return; } if (_mainWindow == null || _optionSettings == null) { return; } if (_isInitialising) { return; } _isInitialising = true; _isGeneralModified = true; if (sender == chkHidePathsRoot) { _optionSettings.HidePathsRoot = chkHidePathsRoot.IsChecked.Value; if (chkHidePathsRoot.IsChecked != null && chkHidePathsRoot.IsChecked.Value) { txtSvgSuitePath.IsReadOnly = true; } else { txtSvgSuitePath.IsReadOnly = false; } txtSvgSuitePath.Text = _optionSettings.GetPath(_optionSettings.LocalSuitePath); } _isInitialising = false; }
private void OnPageLoaded(object sender, RoutedEventArgs e) { if (_mainWindow == null || _mainWindow.OptionSettings == null) { return; } _optionSettings = _mainWindow.OptionSettings; _isInitialising = true; txtSvgSuitePath.Text = _optionSettings.GetPath(_optionSettings.LocalSuitePath); txtSvgSuitePathWeb.Text = _optionSettings.WebSuitePath; txtSvgSuitePath.IsReadOnly = _optionSettings.HidePathsRoot; chkHidePathsRoot.IsChecked = _optionSettings.HidePathsRoot; var testSuites = _optionSettings.TestSuites; if (testSuites != null && testSuites.Count != 0) { cboTestSuites.Items.Clear(); int selectedIndex = 0; for (int i = 0; i < testSuites.Count; i++) { var testSuite = testSuites[i]; ComboBoxItem comboxItem = new ComboBoxItem(); comboxItem.Content = testSuite.Description; comboxItem.Tag = testSuite; cboTestSuites.Items.Add(comboxItem); if (testSuite.IsSelected) { selectedIndex = i; } } cboTestSuites.SelectedIndex = selectedIndex; } _isInitialising = false; }