예제 #1
0
        // getting Coordinates
        public bool Map(string station)
        {
            if (string.IsNullOrEmpty(station))
            {
                return(false);
            }

            Coordinate statoinCoord = m_transport.GetStations(station).StationList.ElementAt(0).Coordinate;
            double     x            = statoinCoord.XCoordinate;
            double     y            = statoinCoord.YCoordinate;
            // changing , to . so Google gets it
            String b = Convert.ToString(x).Replace(',', '.');
            String a = Convert.ToString(y).Replace(',', '.');


            System.Diagnostics.Process.Start("http://www.google.ch/maps/place/" + b + "," + a);
            return(true);
        }
예제 #2
0
 private void GetStations(string text, ListBox listBox)
 {
     try
     {
         if (text.Length >= 3)
         {
             listBox.Items.Clear();
             Stations stations = transport.GetStations(text);
             foreach (Station station in stations.StationList)
             {
                 listBox.Items.Add(station.Name);
                 listBox.Visible = true;
                 listBox.BringToFront();
             }
         }
     }
     catch
     {
         MessageBox.Show("Error", "Station wurde nicht gefunden", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }