示例#1
0
 private void Tbxto_MouseDown(object sender, MouseEventArgs e)
 {
     Stations = Transport.GetStations(tbxto.Text);
     lbxdisplay2.DataSource    = Stations.StationList;
     lbxdisplay2.DisplayMember = "Name";
     if (lbxdisplay2.Items.Count == 0)
     {
         lbxdisplay2.Hide();
     }
 }
示例#2
0
        // End Destination

        private void Tbxto_TextChanged(object sender, EventArgs e)
        {
            var textBox = new TextBox();


            lbxdisplay2.Show();
            Stations = Transport.GetStations(tbxto.Text);
            lbxdisplay2.DataSource    = Stations.StationList;
            lbxdisplay2.DisplayMember = "Name";
        }
 public Abfahrtsplanform(SwissTransport.Stations Abfahrtsplan, ITransport _transport)
 {
     InitializeComponent();
     if (Abfahrtsplan.StationList.Count != 0)
     {
         StationBoardRoot stationBoardRoot = _transport.GetStationBoard(Abfahrtsplan.StationList[0].Name, Abfahrtsplan.StationList[0].Id);
         foreach (StationBoard Item in stationBoardRoot.Entries)
         {
             AbfahrtsplanGrid.Rows.Add(Item.Stop.Departure, Item.Name, Item.To);
         }
     }
     else
     {
         MessageBox.Show("Bitte Wählen Sie eine Gültige Station aus");
     }
 }
        public void Combosearch(ComboBox cb)
        {
            string cbtext = cb.Text;

            if (cbtext.Length >= 3)
            {
                Stations stations = new Stations();
                stations = transport.GetStations(cbtext + ",");
                cb.Items.Clear();
                cb.DroppedDown    = true;
                cb.SelectionStart = cb.Text.Length;
                foreach (Station s in stations.StationList)
                {
                    cb.Items.Add(s.Name);
                }
            }
        }
示例#5
0
        /// <summary>
        /// Sucht die Stationen zusammen, fügt sie in die Combobox und Droppt die Combobox automatisch runter
        /// </summary>
        /// <param name="cb">die ausgewählte Combobox für die Methode</param>
        public void Combosearch(ComboBox cb)
        {
            string cbtext = cb.Text;

            try
            {
                if (cbtext.Length >= 3)
                {
                    Stations stations = new Stations();
                    stations = transport.GetStations(cbtext + ",");
                    cb.Items.Clear();
                    cb.DroppedDown    = true;
                    cb.SelectionStart = cb.Text.Length;
                    foreach (Station s in stations.StationList)
                    {
                        cb.Items.Add(s.Name);
                    }
                }
            }
            catch
            {
                MessageBox.Show("Zu viele Server Requests");
            }
        }
        public void Locations()
        {
            Stations stations = this.testee.GetStations("Sursee,");

            stations.StationList.Should().HaveCount(10);
        }