ValidateDayOfMonth() публичный статический Метод

public static ValidateDayOfMonth ( int day ) : void
day int
Результат void
Пример #1
0
        /// <summary>
        /// Create a CronScheduleBuilder with a cron-expression that sets the
        /// schedule to fire one per month on the given day of month at the given
        /// time (hour and minute).
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="dayOfMonth">the day of the month to fire</param>
        /// <param name="hour">the hour of day to fire</param>
        /// <param name="minute">the minute of the given hour to fire</param>
        /// <returns>the new CronScheduleBuilder</returns>
        /// <seealso cref="CronExpression" />
        public static CronScheduleBuilder MonthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute)
        {
            DateBuilder.ValidateDayOfMonth(dayOfMonth);
            DateBuilder.ValidateHour(hour);
            DateBuilder.ValidateMinute(minute);

            string cronExpression = $"0 {minute} {hour} {dayOfMonth} * ?";

            return(CronScheduleNoParseException(cronExpression));
        }
Пример #2
0
        /// <summary>
        /// Create a CronScheduleBuilder with a cron-expression that sets the
        /// schedule to fire one per month on the given day of month at the given
        /// time (hour and minute).
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="dayOfMonth">the day of the month to fire</param>
        /// <param name="hour">the hour of day to fire</param>
        /// <param name="minute">the minute of the given hour to fire</param>
        /// <returns>the new CronScheduleBuilder</returns>
        /// <seealso cref="CronExpression" />
        public static CronScheduleBuilder MonthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute)
        {
            DateBuilder.ValidateDayOfMonth(dayOfMonth);
            DateBuilder.ValidateHour(hour);
            DateBuilder.ValidateMinute(minute);

            string cronExpression = String.Format("0 {0} {1} {2} * ?", minute, hour, dayOfMonth);

            return(new CronScheduleBuilder(cronExpression));
        }