コード例 #1
0
 public GeofenceLocation(GeofenceLocation loc)
 {
     Latitude  = loc.Latitude;
     Longitude = loc.Longitude;
     Date      = loc.Date;
     Accuracy  = loc.Accuracy;
 }
コード例 #2
0
        internal void SetLastKnownLocation(Android.Locations.Location location)
        {
            if (location != null)
            {
                if (lastKnownGeofenceLocation == null)
                {
                    lastKnownGeofenceLocation = new GeofenceLocation();
                }
                lastKnownGeofenceLocation.Latitude = location.Latitude;
                lastKnownGeofenceLocation.Longitude = location.Longitude;
                double seconds = location.Time / 1000;
                lastKnownGeofenceLocation.Date = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local).AddSeconds(seconds);
               
            }

        }
コード例 #3
0
      void SetLastKnownLocation(CLLocation location)
      {
          if (location != null)
          {
              if (lastKnownGeofenceLocation == null)
              {
                  lastKnownGeofenceLocation = new GeofenceLocation();
              }
             
              lastKnownGeofenceLocation.Latitude = location.Coordinate.Latitude;
              lastKnownGeofenceLocation.Longitude = location.Coordinate.Longitude;
              lastKnownGeofenceLocation.Accuracy = location.HorizontalAccuracy;
              DateTime referenceDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(2001, 1, 1, 0, 0, 0));
              referenceDate.AddSeconds(location.Timestamp.SecondsSinceReferenceDate);

              lastKnownGeofenceLocation.Date = referenceDate;

          }

      }