private void Window_Loaded(object sender, RoutedEventArgs e) { try { HopfieldNetworkOptions options = UtilityCore.ReadOptions <HopfieldNetworkOptions>(FILE); if (options != null && options.ImageFolders != null && options.ImageFolders.Length > 0) { foreach (string folder in options.ImageFolders) { if (AddFolder(folder)) { _imageFolders.Add(folder); } } ResetTraining(); } else { expanderFolder.IsExpanded = true; } SetInkColor(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), this.Title, MessageBoxButton.OK, MessageBoxImage.Error); } }
private void LoadFromFile() { AsteroidFieldOptions options = UtilityCore.ReadOptions <AsteroidFieldOptions>(FILE) ?? new AsteroidFieldOptions(); this.NumStartingObjects = options.NumStaringObjects ?? NumberOfStartingObjects.Normal; this.OctreeShowLines = options.OctreeShowLines ?? false; this.OctreeCentersDrift = options.OctreeCentersDrift ?? true; this.ShowStars = options.ShowStars ?? true; }
private void LoadOptionsFromFile() { MainFormOptions options = UtilityCore.ReadOptions <MainFormOptions>(FILE) ?? new MainFormOptions(); chkAutoClose.IsChecked = options.ShouldAutoClose ?? false; }