コード例 #1
0
        private void Pushpin_DoubleTap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            Pushpin      p  = (Pushpin)sender;
            PushpinModel pm = (PushpinModel)p.DataContext;

            MessageBox.Show(pm.trafficIncident.severityDescription + " " + pm.trafficIncident.typeDescription.ToLower() + ", " + pm.trafficIncident.description);
        }
コード例 #2
0
        private void Pushpin_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            Pushpin      p  = (Pushpin)sender;
            PushpinModel pm = (PushpinModel)p.DataContext;

            if (pm.pushpinContentTypeDescription == true)
            {
                p.Content = pm.typeImage;
                pm.pushpinContentTypeDescription = false;
            }
            else
            {
                p.Content = pm.typeDescription;
                pm.pushpinContentTypeDescription = true;
            }
        }
コード例 #3
0
        private void btnPlan_Click(object sender, RoutedEventArgs e)
        {
            busStopCount       = false;
            itineraryFaveIndex = 0;
            if (tbxStart.Text != "" && tbxDestination.Text != "")
            {
                string item = tbxStart.Text + "," + tbxDestination.Text;

                bool check = false;

                StreamWriter        writer            = null;
                IsolatedStorageFile favourListStorage = IsolatedStorageFile.GetUserStoreForApplication();
                fileStream = new IsolatedStorageFileStream("myFavourite.txt", FileMode.Append, favourListStorage);

                writer = new StreamWriter(RoadMode.fileStream);

                foreach (Favourite s in favouriteList)
                {
                    string checkString = tbxStart.Text + " To " + tbxDestination.Text;
                    if (s.Name.Equals(checkString))
                    {
                        check = true;
                        break;
                    }
                }
                if (check == false)
                {
                    writer.WriteLine(item);
                }

                writer.Flush();
                writer.Close();
                fileStream.Close();
                clearLayer();
                journeyList        = new List <int>();
                ppM                = new PushpinModel();
                busList            = new List <string>();
                busStopList        = new List <localService.busStop>();
                pendingBusStopList = new List <busStop>();
                pathList           = new List <localService.PathLocation>();
                myRouteLayer       = new MapLayer();
                pinLayer           = new MapLayer();
                GPSLayer           = new MapLayer();
                busLayer           = new MapLayer();
                POILayer           = new MapLayer();
                ItineraryLayer     = new MapLayer();
                myMap.Children.Add(ItineraryLayer);
                p                = new Pushpin();
                count            = 0;
                simulateLocation = new List <GeoCoordinate>();
                simulateTimer    = new DispatcherTimer();
                vibrateTimer     = new DispatcherTimer();
                startLocation    = new Location();
                endLocation      = new Location();
                myMap.Children.Add(busLayer);
                myMap.Children.Add(GPSLayer);
                myMap.Children.Add(PushpinModel.contentLayer);
                myMap.Children.Add(pinLayer);
                myMap.Children.Add(myRouteLayer);
                myMap.Children.Add(POILayer);
                myMap.Children.Add(PushpinModel.POIContentLayer);

                POILayer.Visibility = Visibility.Collapsed;
                PushpinModel.POIContentLayer.Visibility = Visibility.Collapsed;

                setCordList();


                geoWatcher.StatusChanged   += new EventHandler <GeoPositionStatusChangedEventArgs>(geoWatcher_StatusChanged);
                geoWatcher.PositionChanged += new EventHandler <GeoPositionChangedEventArgs <GeoCoordinate> >(geoWatcher_PositionChanged);
                // stimulatedGeoWatcher(geoLocation);

                localService.Service1Client journeyClient = new localService.Service1Client();
                journeyClient.GetJourneyAsync(tbxStart.Text, tbxDestination.Text);
                journeyClient.GetJourneyCompleted += new EventHandler <GetJourneyCompletedEventArgs>(journeyClient_GetJourneyCompleted);
            }

            if (tbxStart.Text.Equals(""))
            {
                MessageBox.Show("Please enter your starting location");
            }
            else if (tbxDestination.Text.Equals(""))
            {
                MessageBox.Show("Please enter your destination");
            }
            favouriteIndex = false;
            retrieveHistory();
        }