public TimerModuleDesign()
 {
     Timing1 = new TimerItem();
     Timing2 = new TimerItem();
     Timing3 = new TimerItem();
     Timing4 = new TimerItem();
     Timing5 = new TimerItem();
 }
        private bool WakeTime(TimerItem timeItem, DateTime lastTime)
        {
            //没有启用则退出
            if (timeItem.UseState == false)
            {
                return(false);
            }

            //已经执行过一次则退出
            if (lastTime != default(DateTime) && timeItem.RepeatPeriod == 0)
            {
                return(false);
            }

            if (lastTime == default(DateTime))
            {
                if (DateTime.Now >= timeItem.StartTime)
                {
                    return(true);
                }
            }

            bool isWake = false;

            switch (timeItem.RepeatType)
            {
            case TimerRepeatType.trtMinute:
                if (DateTime.Now >= lastTime.AddMinutes(timeItem.RepeatPeriod))
                {
                    isWake = true;
                }
                break;

            case TimerRepeatType.trtHour:
                if (DateTime.Now >= lastTime.AddHours(timeItem.RepeatPeriod))
                {
                    isWake = true;
                }
                break;

            case TimerRepeatType.trtDay:
                if (DateTime.Now >= lastTime.AddDays(timeItem.RepeatPeriod))
                {
                    isWake = true;
                }
                break;

            case TimerRepeatType.trtWeek:
                if (DateTime.Now >= lastTime.AddDays(timeItem.RepeatPeriod * 7))
                {
                    isWake = true;
                }
                break;

            case TimerRepeatType.trtMonth:
                if (DateTime.Now >= lastTime.AddMonths(timeItem.RepeatPeriod))
                {
                    isWake = true;
                }
                break;

            default:
                isWake = false;
                break;
            }

            //不触发
            if (isWake == false)
            {
                return(false);
            }


            return(true);
        }