private void OnValidate(object sender, RoutedEventArgs e) { // Update defaults Dependencies.Properties.Settings.Default.PeViewerPath = PeviewerPath; int TreeDepth = Dependencies.Properties.Settings.Default.TreeDepth; if (Int32.TryParse(TreeDepthValue.Text, out TreeDepth)) { Dependencies.Properties.Settings.Default.TreeDepth = TreeDepth; } if (TreeBuildCombo.SelectedItem != null) { Dependencies.Properties.Settings.Default.TreeBuildBehaviour = TreeBuildCombo.SelectedItem.ToString(); } if (BinaryCacheCombo.SelectedItem != null) { bool newValue = (bool)(new BinaryCacheOption()).ConvertBack(BinaryCacheCombo.SelectedItem, null, null, null); if (Dependencies.Properties.Settings.Default.BinaryCacheOptionValue != newValue) { System.Windows.MessageBox.Show("The binary caching preference has been modified, you need to restart Dependencies for the modifications to be actually reloaded."); } Dependencies.Properties.Settings.Default.BinaryCacheOptionValue = newValue; } Dependencies.Properties.Settings.Default.Font = FontFamilyListItem.GetDisplayName(SelectedFontFamily); this.Close(); }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); InitializeFontFamilyList(); SelectedFontFamily = new FontFamily(Dependencies.Properties.Settings.Default.Font); SelectListItem(FontFamilyList, FontFamilyListItem.GetDisplayName(SelectedFontFamily)); FontFamilyList.SelectionChanged += new SelectionChangedEventHandler(fontFamilyList_SelectionChanged); }
private void OnValidate(object sender, RoutedEventArgs e) { // Update defaults Dependencies.Properties.Settings.Default.PeViewerPath = PeviewerPath; if (TreeBuildCombo.SelectedItem != null) { Dependencies.Properties.Settings.Default.TreeBuildBehaviour = TreeBuildCombo.SelectedItem.ToString(); } Dependencies.Properties.Settings.Default.Font = FontFamilyListItem.GetDisplayName(SelectedFontFamily); this.Close(); }