Пример #1
0
        private void BtnFly_Click(object sender, EventArgs e)
        {
            ComboboxDialog dialog = new ComboboxDialog(cities);

            dialog.ShowDialog();
            if (dialog.SelectedCity != null)
            {
                if (CityName.Equals(dialog.SelectedCity.Name))
                {
                    MessageBox.Show("Увы, самолёт уже там.");
                }
                else if (plane.status != "В полёте")
                {
                    MessageBox.Show($"На перелет будет потрачено {game.RebasePlane(plane.ID, dialog.SelectedCity.ID)}$");
                    btnFly.Enabled = false;
                    CityName       = "В полёте";
                    plane.status   = "В полёте";
                }
                else
                {
                    MessageBox.Show("Самолёт уже в полёте.");
                }
            }
            else
            {
                if (dialog.PressCancel)
                {
                    return;
                }
                MessageBox.Show("Увы, туда самолёт послать нельзя.");
            }
        }
Пример #2
0
        public bool Equals(ClockInfo other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(CityName.Equals(other.CityName) && TimeZoneId.Equals(other.TimeZoneId));
        }
Пример #3
0
 public override string ToString()
 {
     if (CityName.Equals("remote", StringComparison.InvariantCultureIgnoreCase))
     {
         return("Remote");
     }
     else
     {
         return($"{CityName}, {Province}");
     }
 }