private void onLoadGraphButtonClick(object sender, RoutedEventArgs e)
 {
     Microsoft.Win32.OpenFileDialog dialog = new Microsoft.Win32.OpenFileDialog();
     dialog.Filter = "xml file|*.xml|All files|*.*";
     bool? result = dialog.ShowDialog();
     if (result == true) {
         string filename = dialog.FileName;
         XmlDocument xmlDocument = new XmlDocument();
         try {
             xmlDocument.Load(filename);
         } catch (XmlException ex) {
             MessageBox.Show("Invalid XML file!!!!\n\n\n" + ex.ToString());
             return;
         }
         net = new Net(xmlDocument);
         reloadViewAfterNewNet();
     }
 }
 private void createRandomNet()
 {
     net = new Net();
     kruskall = new Kruskall(net.bridges);
     reloadViewAfterNewNet();
 }
Ejemplo n.º 3
0
 public Window1()
 {
     InitializeComponent();
     net = new Net();
     bridgesListView.ItemsSource = net.Bridges;
 }