Esempio n. 1
0
 /// <summary>
 /// Constructor for a weekly schedule
 /// </summary>
 /// <param name="StartDay"></param>
 /// <param name="StartTime"></param>
 /// <param name="EndDay"></param>
 /// <param name="EndTime"></param>
 public ICalendar(ScheduleDay StartDay, ScheduleTime StartTime, ScheduleDay EndDay, ScheduleTime EndTime) : this(
         ScheduleFrequency.WEEKLY,
         new DateTime(1970, 01, (int)StartDay, StartTime.Hour, StartTime.Minutes, StartTime.Seconds),
         new DateTime(1970, 01, (int)EndDay, EndTime.Hour, EndTime.Minutes, EndTime.Seconds)
         )
 {
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor for a yearly schedule
 /// </summary>
 /// <param name="StartMonth"></param>
 /// <param name="StartDate">The date, value between 1-31</param>
 /// <param name="StartTime"></param>
 /// <param name="EndMonth"></param>
 /// <param name="EndDate">The date, value between 1-31</param>
 /// <param name="Endtime"></param>
 public ICalendar(ScheduleMonth StartMonth, int StartDate, ScheduleTime StartTime, ScheduleMonth EndMonth, int EndDate, ScheduleTime Endtime) : this(
         ScheduleFrequency.YEARLY,
         new DateTime(1970, (int)StartMonth, StartDate, StartTime.Hour, StartTime.Minutes, StartTime.Seconds),
         new DateTime(1970, (int)EndMonth, EndDate, Endtime.Hour, Endtime.Minutes, Endtime.Seconds)
         )
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Constructor for a monthly schedule and specify for which months it applies
 /// </summary>
 /// <param name="StartDate">Start date, value between 1 - 31</param>
 /// <param name="StartTime">Start time</param>
 /// <param name="EndDate">End date, value between 1-31</param>
 /// <param name="EndTime">End time</param>
 /// <param name="Months"></param>
 public ICalendar(int StartDate, ScheduleTime StartTime, int EndDate, ScheduleTime EndTime, ScheduleMonth[] Months) : this(ScheduleFrequency.MONTHLY, new DateTime(1970, 01, StartDate, StartTime.Hour, StartTime.Minutes, StartTime.Seconds), new DateTime(1970, 01, EndDate, EndTime.Hour, EndTime.Minutes, EndTime.Seconds))
 {
     if (!Months.Any())
     {
         throw new Exception("[ICalendar:MonthlySchedule] Months array argument cannot be empty");
     }
     else
     {
         m_months = Months;
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor to create a daily schedule and specify for which days it applies
 /// </summary>
 /// <param name="StartTime"></param>
 /// <param name="EndTime"></param>
 /// <param name="Days">An array of ICalendarDays elements that represent days of the week (ex: MO, TU, WE ...)</param>
 public ICalendar(ScheduleTime StartTime, ScheduleTime EndTime, ScheduleDay[] Days) : this(ScheduleFrequency.DAILY, new DateTime(1970, 01, 01, StartTime.Hour, StartTime.Minutes, StartTime.Seconds), new DateTime(1970, 01, 01, EndTime.Hour, EndTime.Minutes, EndTime.Seconds))
 {
     if (!Days.Any())
     {
         throw new Exception("[ICalendar:DailySchedule] Days array argument cannot be empty");
     }
     else
     {
         m_days = Days;
     }
 }