private void WriteEventAndNotify (BeaconDevice beaconDevice, EventType eventType) { var beacon = _sqlConnection.Table<Beacon> ().Where (b => b.DeviceId == beaconDevice.Id).FirstOrDefault (); if (beacon == null) return; _sqlConnection.GetChildren (beacon); var ev = new BeaconEvent { Beacon = beacon, Type = eventType, Time = DateTime.Now }; _sqlConnection.InsertWithChildren (ev); if (App.Settings.Common.IsNotificationsOnEvents) _notificationService.Show (string.Format (Resources.Strings.NotificaionMessageFormat, eventType, beacon.Name)); }
private void WriteEventAndNotify(BeaconDevice beaconDevice, EventType eventType) { var beacon = _sqlConnection.Table <Beacon> ().Where(b => b.DeviceId == beaconDevice.Id).FirstOrDefault(); if (beacon == null) { return; } _sqlConnection.GetChildren(beacon); var ev = new BeaconEvent { Beacon = beacon, Type = eventType, Time = DateTime.Now }; _sqlConnection.InsertWithChildren(ev); if (App.Settings.Common.IsNotificationsOnEvents) { _notificationService.Show(string.Format(Resources.Strings.NotificaionMessageFormat, eventType, beacon.Name)); } }
public void Left (BeaconDevice beaconDevice) { WriteEventAndNotify (beaconDevice, EventType.Exit); }
public void Enter (BeaconDevice beaconDevice) { WriteEventAndNotify (beaconDevice, EventType.Enter); }
public void Left(BeaconDevice beaconDevice) { WriteEventAndNotify(beaconDevice, EventType.Exit); }
public void Enter(BeaconDevice beaconDevice) { WriteEventAndNotify(beaconDevice, EventType.Enter); }