private void button2_Click(object sender, EventArgs e) { QuickPathFinder = new FindQuickPath(Data); Clear(); if (comboBoxFrom.Text != comboBoxTo.Text) { var path = QuickPathFinder.FindPath(comboBoxFrom.Text, comboBoxTo.Text); Points = Data.FindPoints(path.Cities); CountPoints = Points.Count(); UpdateDataGrid(path); } pictureBox1.Refresh(); }
public MainMenu() { InitializeComponent(); Data = new DataBase(); Rename(); var names = Data.Cities.Select(a => a.Name).ToArray(); Array.Sort(names); comboBoxFrom.Items.AddRange(names); comboBoxTo.Items.AddRange(names); InexpensiveFinder = new FindInexpensivePath(Data); QuickPathFinder = new FindQuickPath(Data); dataGridView1.AllowUserToAddRows = false; Clear(); AllMap = false; //HeadRow = new DataGridViewRow(); }