/// <summary>
        /// Checks if Station exists
        /// </summary>
        /// <param name="station">Station Name</param>
        /// <returns>bool</returns>
        public bool IsStationAvailable(string station)
        {
            StationFinder  stationFinder = new StationFinder();
            List <Station> stations      = stationFinder.FindStations(station);

            if (stations.Count > 0)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        private void cmbEndStation_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }

            cmbEndStation.Items.Clear();

            var            input         = cmbEndStation.Text;
            StationFinder  stationFinder = new StationFinder();
            List <Station> stations      = stationFinder.FindStations((string)input);

            foreach (Station element in stations)
            {
                cmbEndStation.Items.Add(element.Name);
            }

            cmbEndStation.DroppedDown = true;
            e.Handled = true;
        }