public TimeCalendar( TimeCalendarConfig config )
{
if ( config.StartOffset < TimeSpan.Zero )
{
throw new ArgumentOutOfRangeException( "config" );
}
if ( config.EndOffset > TimeSpan.Zero )
{
throw new ArgumentOutOfRangeException( "config" );
}
culture = config.Culture ?? Thread.CurrentThread.CurrentCulture;
yearType = config.YearType.HasValue ? config.YearType.Value : YearType.SystemYear;
startOffset = config.StartOffset.HasValue ? config.StartOffset.Value : DefaultStartOffset;
endOffset = config.EndOffset.HasValue ? config.EndOffset.Value : DefaultEndOffset;
yearBaseMonth = config.YearBaseMonth.HasValue ? config.YearBaseMonth.Value : TimeSpec.CalendarYearStartMonth;
yearWeekType = config.YearWeekType.HasValue ? config.YearWeekType.Value : YearWeekType.Calendar;
dayNameType = config.DayNameType.HasValue ? config.DayNameType.Value : CalendarNameType.Full;
monthNameType = config.MonthNameType.HasValue ? config.MonthNameType.Value : CalendarNameType.Full;
}