Example #1
0
        void CheckWorkTime()
        {
            var now = DateTime.Now;

            if (now < dismissUntil)
            {
                return;
            }

            var begin = workTime.GetWorkBegin(now);

            if (begin == null)
            {
                return;
            }

            var mustGo = begin.Value + Contract.MaxWorkTimePerDay;
            var warn   = new TimeInterval(mustGo - warnBefore, mustGo + warnAfter);

            if (warn.Contains(now))
            {
                ShowWorkTimeAlert();
            }
        }