Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <mabaul@microsoft.com>2019-04-10 14:44:11 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2019-04-10 14:44:11 +0300
commit22c6ed3f1c5e3588489a5ca20ac92a3140d98e1f (patch)
tree160f02b91ca287a0de6027df895d7778ebd2ba74 /mcs/class/referencesource
parent72c8776d8f0e7a257ee771eac735e4435eaef571 (diff)
Add conditionals allowing some calenders to be disabled. (#13730)
Add `GlobalizationMode.Invariant` conditionals to some calendar code. This allows the Japanese, Taiwan and Hebrew calendars to be disabled.
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs b/mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs
index 31fb7d6d256..9506b6f8466 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs
@@ -184,7 +184,7 @@ namespace System.Globalization
InitializeAbbreviatedEraNames(localeName, calendarId);
// Abbreviated English Era Names are only used for the Japanese calendar.
- if (calendarId == (int)CalendarId.JAPAN)
+ if (!GlobalizationMode.Invariant && calendarId == (int)CalendarId.JAPAN)
{
this.saAbbrevEnglishEraNames = JapaneseCalendar.EnglishEraNames();
}
@@ -268,6 +268,10 @@ namespace System.Globalization
case CalendarId.JAPAN:
case CalendarId.JAPANESELUNISOLAR:
+ if (GlobalizationMode.Invariant)
+ {
+ throw new PlatformNotSupportedException();
+ }
this.saEraNames = JapaneseCalendar.EraNames();
break;
@@ -306,7 +310,11 @@ namespace System.Globalization
break;
case CalendarId.JAPAN:
case CalendarId.JAPANESELUNISOLAR:
- this.saAbbrevEraNames = JapaneseCalendar.AbbrevEraNames();
+ if (GlobalizationMode.Invariant)
+ {
+ throw new PlatformNotSupportedException();
+ }
+ this.saAbbrevEraNames = this.saEraNames;
break;
case CalendarId.HIJRI:
case CalendarId.UMALQURA: