diff options
Diffstat (limited to 'src/mscorlib/corefx/System/Globalization/EastAsianLunisolarCalendar.cs')
-rw-r--r-- | src/mscorlib/corefx/System/Globalization/EastAsianLunisolarCalendar.cs | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/mscorlib/corefx/System/Globalization/EastAsianLunisolarCalendar.cs b/src/mscorlib/corefx/System/Globalization/EastAsianLunisolarCalendar.cs index 8f2bbbc10f..84a44a990d 100644 --- a/src/mscorlib/corefx/System/Globalization/EastAsianLunisolarCalendar.cs +++ b/src/mscorlib/corefx/System/Globalization/EastAsianLunisolarCalendar.cs @@ -38,14 +38,13 @@ namespace System.Globalization internal const int DatePartMonth = 2; internal const int DatePartDay = 3; - // Return the type of the East Asian Lunisolar calendars. - // - - //public override CalendarAlgorithmType AlgorithmType { - // get { - // return CalendarAlgorithmType.LunisolarCalendar; - // } - //} + public override CalendarAlgorithmType AlgorithmType + { + get + { + return CalendarAlgorithmType.LunisolarCalendar; + } + } // Return the year number in the 60-year cycle. // @@ -69,7 +68,7 @@ namespace System.Globalization if ((sexagenaryYear < 1) || (sexagenaryYear > 60)) { throw new ArgumentOutOfRangeException( - "sexagenaryYear", + nameof(sexagenaryYear), SR.Format(SR.ArgumentOutOfRange_Range, 1, 60)); } Contract.EndContractBlock(); @@ -86,7 +85,7 @@ namespace System.Globalization if ((sexagenaryYear < 1) || (sexagenaryYear > 60)) { throw new ArgumentOutOfRangeException( - "sexagenaryYear", + nameof(sexagenaryYear), SR.Format(SR.ArgumentOutOfRange_Range, 1, 60)); } Contract.EndContractBlock(); @@ -133,7 +132,7 @@ namespace System.Globalization return (mEraInfo[i].minEraYear); } } - throw new ArgumentOutOfRangeException("era", SR.ArgumentOutOfRange_InvalidEraValue); + throw new ArgumentOutOfRangeException(nameof(era), SR.ArgumentOutOfRange_InvalidEraValue); } internal int MaxEraCalendarYear(int era) @@ -162,7 +161,7 @@ namespace System.Globalization return (mEraInfo[i].maxEraYear); } } - throw new ArgumentOutOfRangeException("era", SR.ArgumentOutOfRange_InvalidEraValue); + throw new ArgumentOutOfRangeException(nameof(era), SR.ArgumentOutOfRange_InvalidEraValue); } internal EastAsianLunisolarCalendar() @@ -190,7 +189,7 @@ namespace System.Globalization if ((era < GetEra(MinDate)) || (era > GetEra(MaxDate))) { - throw new ArgumentOutOfRangeException("era", SR.ArgumentOutOfRange_InvalidEraValue); + throw new ArgumentOutOfRangeException(nameof(era), SR.ArgumentOutOfRange_InvalidEraValue); } } @@ -202,7 +201,7 @@ namespace System.Globalization if ((year < MinCalendarYear) || (year > MaxCalendarYear)) { throw new ArgumentOutOfRangeException( - "year", + nameof(year), SR.Format(SR.ArgumentOutOfRange_Range, MinEraCalendarYear(era), MaxEraCalendarYear(era))); } return year; @@ -216,12 +215,12 @@ namespace System.Globalization { //Reject if there is no leap month this year if (GetYearInfo(year, LeapMonth) == 0) - throw new ArgumentOutOfRangeException("month", SR.ArgumentOutOfRange_Month); + throw new ArgumentOutOfRangeException(nameof(month), SR.ArgumentOutOfRange_Month); } if (month < 1 || month > 13) { - throw new ArgumentOutOfRangeException("month", SR.ArgumentOutOfRange_Month); + throw new ArgumentOutOfRangeException(nameof(month), SR.ArgumentOutOfRange_Month); } return year; } @@ -266,7 +265,7 @@ namespace System.Globalization if (day < 1 || day > daysInMonth) { throw new ArgumentOutOfRangeException( - "day", + nameof(day), SR.Format(SR.ArgumentOutOfRange_Day, daysInMonth, month)); } @@ -447,7 +446,7 @@ namespace System.Globalization if (months < -120000 || months > 120000) { throw new ArgumentOutOfRangeException( - "months", + nameof(months), SR.Format(SR.ArgumentOutOfRange_Range, -120000, 120000)); } Contract.EndContractBlock(); @@ -627,7 +626,7 @@ namespace System.Globalization if (day < 1 || day > daysInMonth) { throw new ArgumentOutOfRangeException( - "day", + nameof(day), SR.Format(SR.ArgumentOutOfRange_Day, daysInMonth, month)); } int m = GetYearInfo(year, LeapMonth); @@ -694,7 +693,7 @@ namespace System.Globalization if (value < 99 || value > MaxCalendarYear) { throw new ArgumentOutOfRangeException( - "value", + nameof(value), SR.Format(SR.ArgumentOutOfRange_Range, 99, MaxCalendarYear)); } twoDigitYearMax = value; @@ -706,7 +705,7 @@ namespace System.Globalization { if (year < 0) { - throw new ArgumentOutOfRangeException("year", + throw new ArgumentOutOfRangeException(nameof(year), SR.ArgumentOutOfRange_NeedNonNegNum); } Contract.EndContractBlock(); |