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