Ejemplo n.º 1
0
        public void FinalDayTest()
        {
            DateTime currentUTC = DateTime.UtcNow;
            int      day        = (int)currentUTC.DayOfWeek;
            int      hour       = currentUTC.Hour;

            if ((day == 3 && hour >= 7) || (day == 4 && hour < 7))
            {
                Assert.IsTrue(CycleService.FinalDay());
            }
            else
            {
                Assert.IsFalse(CycleService.FinalDay());
            }
        }
Ejemplo n.º 2
0
        private void UpdateTimeRemaining()
        {
            TimeRemaining = CycleService.TimeRemaining();
            CycleImminent = CycleService.CycleImminent();
            if (CycleImminent)
            {
                TimeRemainingColor = Color.DarkRed;
            }
            else
            {
                TimeRemainingColor = ThemeHelper.GetThemeColor("brandColor");
            }
            ShowTimeRemaining = !settings.OnlyShowNextCycleWhenImminent || CycleService.CycleImminent();

            if (pageVisible && (CycleService.FinalDay() || DateTime.UtcNow.Minute == 59))
            {
                Device.StartTimer(TimeSpan.FromSeconds(60 - DateTime.UtcNow.Second), () =>
                {
                    UpdateTimeRemaining();
                    return(false);
                });
            }
        }