Exemple #1
0
        public frmAddConnection(List <City> cities, City currentCity)
        {
            InitializeComponent();
            _errorLabel = new ErrorLabelWrapper(lblError);

            _cities      = cities;
            _currentCity = currentCity;

            var possibleCitiesToConnect = _cities.Where(c => !currentCity.Connections.Any(connection => connection.City.Name == c.Name) && c.Name != currentCity.Name);

            cmbConnectionTo.Items.AddRange(possibleCitiesToConnect.Select(c => c.Name).ToArray());

            if (cmbConnectionTo.Items.Count > 0)
            {
                cmbConnectionTo.SelectedIndex = 0;
            }
        }
 public frmAddCity(List <City> cities)
 {
     InitializeComponent();
     _errorLabel = new ErrorLabelWrapper(lblError);
     _cities     = cities;
 }