コード例 #1
0
        public void LMAddHelper()
        {
            DatabaseMgr dbMgr = new DatabaseMgr();

            dbMgr.AddLMLocation(new LMLocation(46.83016, -96.829341, new DateTime(2014, 12, 9, 17, 0, 0), 100000, "Home"));
            dbMgr.AddLMLocation(new LMLocation(46.8936083, -96.8035308, new DateTime(2014, 12, 9, 17, 0, 0), 20000, "NDSU"));
            dbMgr.AddLMLocation(new LMLocation(46.836152, -96.879533, new DateTime(2014, 12, 9, 17, 0, 0), 5000, "Gym"));
        }
コード例 #2
0
        private async void SaveLocation(object sender, RoutedEventArgs e)
        {
            DatabaseMgr dbMgr = new DatabaseMgr();

            if (geo == null)
            {
                geo = new Geolocator();
            }

            geo.DesiredAccuracyInMeters = 25;
            Geoposition pos = await geo.GetGeopositionAsync();

            double lat = pos.Coordinate.Point.Position.Latitude;
            double lon = pos.Coordinate.Point.Position.Longitude;

            if (locInput.Text != null)
            {
                dbMgr.AddLMLocation(new LMLocation(lat, lon, DateTime.Now, 1000000, locInput.Text));
                NavigationService.Navigate(new Uri("/MainPage.xaml?goto=3", UriKind.Relative));
            }
        }