Example #1
0
        protected override sealed void UpdateUserInterface()
        {
            if (TimeFrom.Value >= TimeTo.Value)
            {
                TimeTo.Value = TimeFrom.Value.AddSeconds(5);
            }
            mCalendar.SetTimeRange(TimeFrom.Value, TimeTo.Value);
            mCalendar.InvertTimeRange = InvertRange.Checked;

            // If the property invertTimeRange is false(default), the time range defines a range
            // of times in which triggers are not allowed to fire. If invertTimeRange is true, the
            // time range is inverted: that is, all times outside the defined time range are excluded.
            mCalendar.Description = string.Format("{0} {1} to {2}",
                                                  mCalendar.InvertTimeRange ? "Including" : "Excluding",
                                                  mCalendar.GetTimeRangeStartingTimeUtc(new DateTimeOffset()).ToString(TimeFrom.CustomFormat),
                                                  mCalendar.GetTimeRangeEndingTimeUtc(new DateTimeOffset()).ToString(TimeTo.CustomFormat));
        }
Example #2
0
 static void InitializeDaily(DailyCalendar dailyCalendar, IDailyCalendar calendar)
 {
     dailyCalendar.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(calendar.TimeZone));
     calendar.DateRanges.ToList().ForEach(range => dailyCalendar.SetTimeRange(range.StartPoint, range.EndPoint));
 }