Exemplo n.º 1
0
        public Locktimer(Locker locker)
        {
            _locker         = locker;
            _timeController = new RemainingTimeController(LastSessionSynchronizer.GetAllowedTime());

            locker.LockStatusChanged += SessionSwitchEvent;
            locker.SystemShutdown    += SaveData;
            _timeController.TimeOut  += Lock;
        }
Exemplo n.º 2
0
        private void SaveData(object o, EventArgs e)
        {
            var remaningTimeToLock = _timeController.RemainingTimeToLock;

            if (remaningTimeToLock > Properties.Settings.Default.MaxAllowedTime)
            {
                remaningTimeToLock -= Properties.Settings.Default.MaxAllowedTime;
            }

            LastSessionSynchronizer.SaveSessionData(remaningTimeToLock);
        }