GetNextTime() static private method

static private GetNextTime ( NotificationFrequency freq, System.DateTime now ) : System.DateTime
freq NotificationFrequency
now System.DateTime
return System.DateTime
示例#1
0
        internal static void TimerTick(DateTime now, NotificationFrequency freq)
        {
            switch (freq)
            {
            case NotificationFrequency.Immediately: if (!Configuration.ImmediatelyEnabled)
                {
                    return;
                }
                break;

            case NotificationFrequency.Daily: if (!Configuration.DailyEnabled)
                {
                    return;
                }
                break;

            case NotificationFrequency.Weekly: if (!Configuration.WeeklyEnabled)
                {
                    return;
                }
                break;

            case NotificationFrequency.Monthly: if (!Configuration.MonthlyEnabled)
                {
                    return;
                }
                break;

            default: throw GetUnknownFrequencyException(freq);
            }

            if (now >= LastProcessTime.GetNextTime(freq, now))
            {
                GenerateMessages(freq, now);
            }
        }