Ejemplo n.º 1
0
 private async Task PrepareLogAsync(Log log)
 {
     if (log.Device == null && _device == null)
     {
         _device = await _deviceInfoHelper.GetDeviceInformationAsync().ConfigureAwait(false);
     }
     log.Device = log.Device ?? _device;
     if (log.Toffset == 0L)
     {
         log.Toffset = TimeHelper.CurrentTimeInMilliseconds();
     }
 }
Ejemplo n.º 2
0
        private async Task PrepareLogAsync(Log log, State state)
        {
            if (log.Device == null && _device == null)
            {
                var device = await _deviceInfoHelper.GetDeviceInformationAsync().ConfigureAwait(false);

                using (await _mutex.GetLockAsync(state).ConfigureAwait(false))
                {
                    _device = device;
                }
            }
            log.Device    = log.Device ?? _device;
            log.Timestamp = log.Timestamp ?? DateTime.Now;
        }