public static async void AttachLocationAsync(
            this SessionModel session,
            params ReportMessage.Session.Event[] items)
        {
            ReportMessage.Location location = Config.Global.CustomLocation;
            if (location == null)
            {
                session.AsyncLocationLock = true;
                await ServiceData.WaitExposeAsync();

                ReportMessage.Location location1 = location;
                location = await ServiceData.LocationTracker.Provide();

                session.AsyncLocationLock = false;
            }
            ((IEnumerable <ReportMessage.Session.Event>)items).ForEach <ReportMessage.Session.Event>((Action <ReportMessage.Session.Event>)(i => i.location = location));
        }
Beispiel #2
0
 public void SetCustomLocation(YandexMetrica.Location location)
 {
     ReportMessage.Location location1;
     if (location != null)
     {
         location1 = new ReportMessage.Location()
         {
             lat       = location.Lat,
             lon       = location.Lon,
             speed     = new uint?(location.Speed),
             altitude  = new int?(location.Altitude),
             direction = new uint?(location.Direction),
             precision = new uint?(location.Precision),
             timestamp = new ulong?(location.Timestamp)
         }
     }
     ;
     else
     {
         location1 = (ReportMessage.Location)null;
     }
     this.CustomLocation = location1;
 }