private void Wczytaj_Sieć(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.Filter = "XML Files (.xml)|*.xml"; Nullable <bool> result = dlg.ShowDialog(); if (result == true) { string fileName = dlg.FileName; try { NeuralNetwork = SerializationClass.ConDeSerializer(NeuralNetwork, fileName); Network randomnet = SerializationClass.ConDeSerializer(NeuralNetwork, fileName); UczenieSieci.IsEnabled = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Failed to open File"); } }
private void DeSerializeBoW_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.Filter = "XML Files (.xml)|*.xml"; Nullable <bool> result = dlg.ShowDialog(); if (result == true) { string fileName = dlg.FileName; try { bow = SerializationClass.ConDeSerializer(bow, fileName); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Failed to open File"); } }