private void btnWeightsLoad_Click(object sender, EventArgs e) { var plik = new OpenFileDialog(); if (plik.ShowDialog() == DialogResult.OK) { var countOfLines = CountingSize(plik); var weights = LoadWeights(countOfLines[0], countOfLines[1], plik); try { _graph.AddAllWeights(weights); DrawGraph(); rtxtReportingWindow.Text += "Dodano wagi.\n"; } catch (ArgumentException exception) { MessageBox.Show(exception.Message); } catch (NullReferenceException) { MessageBox.Show("Błąd: graf nie istnieje."); } } }