public void Handle(AddictionalData data, object tag)
        {
            var user        = tag as User;
            var device      = data.Resolve <DeviceInfo>();
            var geolocation = data.Resolve <Geolocation>();

            if (user != null && geolocation != null)
            {
                Log.InfoFormat("User [{0}] device: [{1}];", user.Name, device?.Name ?? "unknown");
                Log.InfoFormat("User [{0}] new geolocation: [{1}]; source: [{2}];", user.Name, geolocation, geolocation.IsGPS ? "GPS" : "unknown");
                user.UpdateLocation(new GeolocationInfo(geolocation, device?.Name ?? "[unknown device]"));
            }
        }
Exemplo n.º 2
0
 public void Handle(AddictionalData data, object tag)
 {
     try
     {
         if (_notifier != null)
         {
             var messages = data.Resolve <Messages>();
             if (messages?.All != null)
             {
                 foreach (var message in messages.All)
                 {
                     _notifier.Notify(message);
                 }
             }
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }