Esempio n. 1
0
		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));
		}
Esempio n. 2
0
        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));
            }
        }
Esempio n. 3
0
		public void Left (BeaconDevice beaconDevice)
		{
			WriteEventAndNotify (beaconDevice, EventType.Exit);
		}
Esempio n. 4
0
		public void Enter (BeaconDevice beaconDevice)
		{
			WriteEventAndNotify (beaconDevice, EventType.Enter);
		}
Esempio n. 5
0
 public void Left(BeaconDevice beaconDevice)
 {
     WriteEventAndNotify(beaconDevice, EventType.Exit);
 }
Esempio n. 6
0
 public void Enter(BeaconDevice beaconDevice)
 {
     WriteEventAndNotify(beaconDevice, EventType.Enter);
 }