示例#1
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     InexpensiveFinder = new FindInexpensivePath(Data);
     Clear();
     if (comboBoxFrom.Text != comboBoxTo.Text)
     {
         var path = InexpensiveFinder.FindPath(comboBoxFrom.Text, comboBoxTo.Text);
         Points      = Data.FindPoints(path.Cities);
         CountPoints = Points.Count();
         UpdateDataGrid(path);
     }
     pictureBox1.Refresh();
 }
示例#2
0
        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();
        }