Example #1
0
        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);
            }
        }
Example #2
0
        private void Window_Closed(object sender, EventArgs e)
        {
            try
            {
                HopfieldNetworkOptions options = new HopfieldNetworkOptions()
                {
                    ImageFolders = _imageFolders.ToArray(),
                };

                UtilityCore.SaveOptions(options, FILE);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        private void Window_Closed(object sender, EventArgs e)
        {
            try
            {
                HopfieldNetworkOptions options = new HopfieldNetworkOptions()
                {
                    ImageFolders = _imageFolders.ToArray(),
                };

                UtilityCore.SaveOptions(options, FILE);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }