コード例 #1
0
        public async Task GetChildLastLocation()
        {
            var requester      = new LocationsHttpRequester();
            var latestLocation = await requester.GetLocation();


            //TODO: >>Add user filtraton for multiple users

            if (latestLocation != null)
            {
                var position = new BasicGeoposition();
                position.Latitude     = latestLocation.Latitude;
                position.Longitude    = latestLocation.Longitude;
                this.CurrentSelection = position;

                var dbLocation = new SQLiteLocationModel()
                {
                    Latitude     = latestLocation.Latitude,
                    Longitude    = latestLocation.Longitude,
                    LocationDate = (DateTime)latestLocation.CreationDate,
                    UserId       = LocalData.USERNAME
                };

                ((ObservableCollection <SQLiteLocationModel>) this.LatestLocationReviews).Insert(0, dbLocation);
                await this._locationsDb.AddLocation(dbLocation);
            }
        }