示例#1
0
 void HandleButtonClick()
 {
     ClicksNumber++;
     ClicksLeft = ClicksLimit - ClicksNumber;
     if (ClicksNumber >= ClicksLimit) // Alarm kapa
     {
         DependencyService.Get <IAudio>().Stop();
         _stopped = true;
         vibrator.Cancel();
         OnAlarmTurnedOff?.Invoke(this, new EventArgs());
     }
 }
示例#2
0
        public void AddShake(object sender, EventArgs args)
        {
            ShakeCount++;
            ShakesLeft = _shakeLimit - ShakeCount;

            if (ShakeCount == _shakeLimit)
            { // alarm stopped
                DependencyService.Get <IAudio>().Stop();
                _stopped = true;
                //    Rotation = 0;
                manager.UnregisterListener(ss);
                manager.Dispose();
                ss.Dispose();
                OnAlarmTurnedOff?.Invoke(this, new EventArgs());
            }
        }