From cfc68aa3a9ce8155e677cb47247f7029fad81be1 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Sat, 1 Apr 2017 12:25:28 -0700 Subject: [PATCH] Move identical Globalization files to shared partition Commit migrated from https://github.com/dotnet/coreclr/commit/b07ed5efbbc94a0a3dad203e0a88d25c746a6c93 --- .../src/mscorlib/System.Private.CoreLib.csproj | 30 ---------------------- .../shared/System.Private.CoreLib.Shared.projitems | 30 ++++++++++++++++++++++ .../System/Globalization/CalendarAlgorithmType.cs | 2 -- .../System/Globalization/CalendarWeekRule.cs | 2 -- .../Globalization/CalendricalCalculationsHelper.cs | 0 .../Globalization/ChineseLunisolarCalendar.cs | 6 ----- .../Globalization/CultureNotFoundException.cs | 4 +-- .../shared/System/Globalization/CultureTypes.cs | 27 +++++++++++++++++++ .../shared/System/Globalization/DateTimeFormat.cs | 9 ++----- .../Globalization/DateTimeFormatInfoScanner.cs | 3 --- .../shared/System/Globalization/DateTimeParse.cs | 29 ++++----------------- .../System/Globalization/DateTimeStyles.cs | 1 - .../System/Globalization/DaylightTime.cs | 2 -- .../System/Globalization/DigitShapes.cs | 5 ---- .../Globalization/EastAsianLunisolarCalendar.cs | 7 ----- .../System/Globalization/GregorianCalendarTypes.cs | 2 -- .../System/Globalization/HebrewCalendar.cs | 0 .../System/Globalization/HebrewNumber.cs | 0 .../System/Globalization/HijriCalendar.cs | 2 -- .../Globalization/InternalGlobalizationHelper.cs | 4 +-- .../System/Globalization/JapaneseCalendar.cs | 2 -- .../Globalization/JapaneseLunisolarCalendar.cs | 6 ----- .../System/Globalization/JulianCalendar.cs | 1 - .../System/Globalization/KoreanCalendar.cs | 1 - .../Globalization/KoreanLunisolarCalendar.cs | 6 ----- .../System/Globalization/LocaleData.Unix.cs | 0 .../System/Globalization/NumberStyles.cs | 3 --- .../System/Globalization/PersianCalendar.cs | 5 ---- .../System/Globalization/SortVersion.cs | 3 --- .../System/Globalization/TaiwanCalendar.cs | 0 .../Globalization/TaiwanLunisolarCalendar.cs | 13 +++------- .../System/Globalization/ThaiBuddhistCalendar.cs | 0 .../System/Globalization/TimeSpanStyles.cs | 0 .../System/Globalization/UmAlQuraCalendar.cs | 5 ---- .../System/Globalization/UnicodeCategory.cs | 30 ---------------------- .../mscorlib/src/System/Globalization/Calendar.cs | 2 +- .../src/System/Globalization/CultureTypes.cs | 28 -------------------- .../Globalization/GregorianCalendarHelper.cs | 2 +- 38 files changed, 72 insertions(+), 200 deletions(-) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/CalendarAlgorithmType.cs (98%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/CalendarWeekRule.cs (97%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/CalendricalCalculationsHelper.cs (100%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/ChineseLunisolarCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/CultureNotFoundException.cs (97%) create mode 100644 src/coreclr/src/mscorlib/shared/System/Globalization/CultureTypes.cs rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/DateTimeStyles.cs (98%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/DaylightTime.cs (98%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/DigitShapes.cs (83%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/EastAsianLunisolarCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/GregorianCalendarTypes.cs (98%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/HebrewCalendar.cs (100%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/HebrewNumber.cs (100%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/HijriCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/InternalGlobalizationHelper.cs (97%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/JapaneseCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/JapaneseLunisolarCalendar.cs (98%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/JulianCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/KoreanCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/KoreanLunisolarCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/LocaleData.Unix.cs (100%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/NumberStyles.cs (98%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/PersianCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/SortVersion.cs (97%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/TaiwanCalendar.cs (100%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/TaiwanLunisolarCalendar.cs (98%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/ThaiBuddhistCalendar.cs (100%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/TimeSpanStyles.cs (100%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/UmAlQuraCalendar.cs (99%) rename src/coreclr/src/mscorlib/{src => shared}/System/Globalization/UnicodeCategory.cs (95%) delete mode 100644 src/coreclr/src/mscorlib/src/System/Globalization/CultureTypes.cs diff --git a/src/coreclr/src/mscorlib/System.Private.CoreLib.csproj b/src/coreclr/src/mscorlib/System.Private.CoreLib.csproj index 39695c5..a5cce4f 100644 --- a/src/coreclr/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/mscorlib/System.Private.CoreLib.csproj @@ -506,54 +506,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -588,7 +559,6 @@ - diff --git a/src/coreclr/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems b/src/coreclr/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems index 3acace8..7c6d039 100644 --- a/src/coreclr/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/coreclr/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems @@ -138,10 +138,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -339,6 +368,7 @@ + diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/CalendarAlgorithmType.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/CalendarAlgorithmType.cs similarity index 98% rename from src/coreclr/src/mscorlib/src/System/Globalization/CalendarAlgorithmType.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/CalendarAlgorithmType.cs index 159b0e6..4ddc307 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/CalendarAlgorithmType.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/CalendarAlgorithmType.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - namespace System.Globalization { public enum CalendarAlgorithmType diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/CalendarWeekRule.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs similarity index 97% rename from src/coreclr/src/mscorlib/src/System/Globalization/CalendarWeekRule.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs index 4013ce7..b381b5c 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/CalendarWeekRule.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - namespace System.Globalization { [Serializable] diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/CalendricalCalculationsHelper.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/CalendricalCalculationsHelper.cs similarity index 100% rename from src/coreclr/src/mscorlib/src/System/Globalization/CalendricalCalculationsHelper.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/CalendricalCalculationsHelper.cs diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/ChineseLunisolarCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/ChineseLunisolarCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs index dc9e5fd..404add0 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/ChineseLunisolarCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs @@ -2,16 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Diagnostics.Contracts; namespace System.Globalization { - //////////////////////////////////////////////////////////////////////////// - // - // Notes about ChineseLunisolarCalendar - // - //////////////////////////////////////////////////////////////////////////// /* ** Calendar support range: ** Calendar Minimum Maximum diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/CultureNotFoundException.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs similarity index 97% rename from src/coreclr/src/mscorlib/src/System/Globalization/CultureNotFoundException.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs index d296ad8..929f4bb 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/CultureNotFoundException.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs @@ -2,14 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Runtime.Serialization; -using System.Threading; namespace System.Globalization { [Serializable] - public class CultureNotFoundException : ArgumentException, ISerializable + public class CultureNotFoundException : ArgumentException { private string _invalidCultureName; // unrecognized culture name private int? _invalidCultureId; // unrecognized culture Lcid diff --git a/src/coreclr/src/mscorlib/shared/System/Globalization/CultureTypes.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/CultureTypes.cs new file mode 100644 index 0000000..f52ac82 --- /dev/null +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/CultureTypes.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// The enumeration constants used in CultureInfo.GetCultures(). +// On Linux platforms, the only enum values used there is NeutralCultures and SpecificCultures +// the rest are obsolete or not valid on Linux + +namespace System.Globalization +{ + [Flags] + public enum CultureTypes + { + NeutralCultures = 0x0001, // Neutral cultures are cultures like "en", "de", "zh", etc, for enumeration this includes ALL neutrals regardless of other flags + SpecificCultures = 0x0002, // Non-netural cultuers. Examples are "en-us", "zh-tw", etc., for enumeration this includes ALL specifics regardless of other flags + InstalledWin32Cultures = 0x0004, // Win32 installed cultures in the system and exists in the framework too., this is effectively all cultures + + AllCultures = NeutralCultures | SpecificCultures | InstalledWin32Cultures, + + UserCustomCulture = 0x0008, // User defined custom culture + ReplacementCultures = 0x0010, // User defined replacement custom culture. + [Obsolete("This value has been deprecated. Please use other values in CultureTypes.")] + WindowsOnlyCultures = 0x0020, // this will always return empty list. + [Obsolete("This value has been deprecated. Please use other values in CultureTypes.")] + FrameworkCultures = 0x0040, // will return only the v2 cultures marked as Framework culture. + } +} diff --git a/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeFormat.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeFormat.cs index d3bf255..840409f 100644 --- a/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeFormat.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeFormat.cs @@ -2,16 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Text; -using System.Threading; -using System.Globalization; using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Versioning; -using System.Security; using System.Diagnostics; using System.Diagnostics.Contracts; +using System.Globalization; +using System.Text; namespace System { diff --git a/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeFormatInfoScanner.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeFormatInfoScanner.cs index ddf7d7e..15af1b7 100644 --- a/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeFormatInfoScanner.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeFormatInfoScanner.cs @@ -19,9 +19,6 @@ // //////////////////////////////////////////////////////////////////////////// -using System; -using System.Globalization; -using System.Collections; using System.Collections.Generic; using System.Text; diff --git a/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeParse.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeParse.cs index 857ffc6..910fbf2 100644 --- a/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeParse.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeParse.cs @@ -2,33 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -//////////////////////////////////////////////////////////////////////////// -// -// -// Purpose: This class is called by DateTime to parse a date/time string. -// -//////////////////////////////////////////////////////////////////////////// +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Globalization; +using System.Text; namespace System { - using System; - using System.Text; - using System.Globalization; - using System.Threading; - using System.Collections; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; - using System.Runtime.Versioning; - using System.Security; - using System.Diagnostics; - using System.Diagnostics.Contracts; - - //////////////////////////////////////////////////////////////////////// - - //This class contains only static members - - internal static - class DateTimeParse + internal static class DateTimeParse { internal const Int32 MaxDateTimeNumberDigits = 8; diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/DateTimeStyles.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeStyles.cs similarity index 98% rename from src/coreclr/src/mscorlib/src/System/Globalization/DateTimeStyles.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeStyles.cs index cd551cb..79232ff 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/DateTimeStyles.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/DateTimeStyles.cs @@ -14,7 +14,6 @@ namespace System.Globalization { - [Serializable] [Flags] public enum DateTimeStyles { diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/DaylightTime.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/DaylightTime.cs similarity index 98% rename from src/coreclr/src/mscorlib/src/System/Globalization/DaylightTime.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/DaylightTime.cs index f066e4b..b3c70e1 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/DaylightTime.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/DaylightTime.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - namespace System.Globalization { // This class represents a starting/ending time for a period of daylight saving time. diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/DigitShapes.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/DigitShapes.cs similarity index 83% rename from src/coreclr/src/mscorlib/src/System/Globalization/DigitShapes.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/DigitShapes.cs index b21f480..1ce45db 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/DigitShapes.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/DigitShapes.cs @@ -2,13 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// -// The enumeration constants used in NumberFormatInfo.DigitSubstitution. -// - namespace System.Globalization { - [Serializable] public enum DigitShapes : int { Context = 0x0000, // The shape depends on the previous text in the same output. diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/EastAsianLunisolarCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/EastAsianLunisolarCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs index f82fad8..d06b13c 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/EastAsianLunisolarCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs @@ -2,17 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Diagnostics.Contracts; namespace System.Globalization { - //////////////////////////////////////////////////////////////////////////// - // - // Notes about EastAsianLunisolarCalendar - // - //////////////////////////////////////////////////////////////////////////// - [Serializable] public abstract class EastAsianLunisolarCalendar : Calendar { diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/GregorianCalendarTypes.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs similarity index 98% rename from src/coreclr/src/mscorlib/src/System/Globalization/GregorianCalendarTypes.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs index a14010f..1b61e52 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/GregorianCalendarTypes.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - namespace System.Globalization { // Note: The values of the members of this enum must match the coresponding values diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/HebrewCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs similarity index 100% rename from src/coreclr/src/mscorlib/src/System/Globalization/HebrewCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/HebrewNumber.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/HebrewNumber.cs similarity index 100% rename from src/coreclr/src/mscorlib/src/System/Globalization/HebrewNumber.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/HebrewNumber.cs diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/HijriCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/HijriCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/HijriCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/HijriCalendar.cs index 0c72d9e..cafde5f 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/HijriCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/HijriCalendar.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Runtime.Versioning; using System.Diagnostics.Contracts; namespace System.Globalization diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/InternalGlobalizationHelper.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/InternalGlobalizationHelper.cs similarity index 97% rename from src/coreclr/src/mscorlib/src/System/Globalization/InternalGlobalizationHelper.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/InternalGlobalizationHelper.cs index 0a4e6f0..f5eea1b 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/InternalGlobalizationHelper.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/InternalGlobalizationHelper.cs @@ -2,11 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - namespace System.Globalization { - internal class InternalGloablizationHelper + internal class InternalGlobalizationHelper { // Copied from the TimeSpan to be used inside the globalization code and avoid internal dependancy on TimeSpan class internal static long TimeToTicks(int hour, int minute, int second) diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs index f0216c8..4655e08 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/JapaneseLunisolarCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs similarity index 98% rename from src/coreclr/src/mscorlib/src/System/Globalization/JapaneseLunisolarCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs index cc3d349..95e87f8 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/JapaneseLunisolarCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs @@ -2,16 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Diagnostics.Contracts; namespace System.Globalization { - //////////////////////////////////////////////////////////////////////////// - // - // Notes about JapaneseLunisolarCalendar - // - //////////////////////////////////////////////////////////////////////////// /* ** Calendar support range: ** Calendar Minimum Maximum diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/JulianCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/JulianCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/JulianCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/JulianCalendar.cs index 43e6ad0..f4678c1 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/JulianCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/JulianCalendar.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Diagnostics.Contracts; namespace System.Globalization diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/KoreanCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/KoreanCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs index b015aa0..b962b1c 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/KoreanCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/KoreanLunisolarCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/KoreanLunisolarCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs index 6d09128..d4c7163 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/KoreanLunisolarCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs @@ -2,16 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Diagnostics.Contracts; namespace System.Globalization { - //////////////////////////////////////////////////////////////////////////// - // - // Notes about KoreanLunisolarCalendar - // - //////////////////////////////////////////////////////////////////////////// /* ** Calendar support range: ** Calendar Minimum Maximum diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/LocaleData.Unix.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/LocaleData.Unix.cs similarity index 100% rename from src/coreclr/src/mscorlib/src/System/Globalization/LocaleData.Unix.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/LocaleData.Unix.cs diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/NumberStyles.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/NumberStyles.cs similarity index 98% rename from src/coreclr/src/mscorlib/src/System/Globalization/NumberStyles.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/NumberStyles.cs index 31eafc9..5909d65 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/NumberStyles.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/NumberStyles.cs @@ -12,11 +12,8 @@ ** ===========================================================*/ -using System; - namespace System.Globalization { - [Serializable] [Flags] public enum NumberStyles { diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/PersianCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/PersianCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/PersianCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/PersianCalendar.cs index b8b3da6..445bbd6 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/PersianCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/PersianCalendar.cs @@ -7,11 +7,6 @@ using System.Diagnostics.Contracts; namespace System.Globalization { - //////////////////////////////////////////////////////////////////////////// - // - // Notes about PersianCalendar - // - //////////////////////////////////////////////////////////////////////////// // Modern Persian calendar is a solar observation based calendar. Each new year begins on the day when the vernal equinox occurs before noon. // The epoch is the date of the vernal equinox prior to the epoch of the Islamic calendar (March 19, 622 Julian or March 22, 622 Gregorian) diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/SortVersion.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/SortVersion.cs similarity index 97% rename from src/coreclr/src/mscorlib/src/System/Globalization/SortVersion.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/SortVersion.cs index 9d6118e..a7aef6d 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/SortVersion.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/SortVersion.cs @@ -2,9 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Diagnostics.Contracts; - namespace System.Globalization { [Serializable] diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/TaiwanCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs similarity index 100% rename from src/coreclr/src/mscorlib/src/System/Globalization/TaiwanCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/TaiwanLunisolarCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs similarity index 98% rename from src/coreclr/src/mscorlib/src/System/Globalization/TaiwanLunisolarCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs index 1f75ac9..8ba1f27 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/TaiwanLunisolarCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs @@ -7,17 +7,12 @@ using System.Diagnostics.Contracts; namespace System.Globalization { - //////////////////////////////////////////////////////////////////////////// - // - // Notes about TaiwanLunisolarCalendar - // - //////////////////////////////////////////////////////////////////////////// /* ** Calendar support range: - ** Calendar Minimum Maximum - ** ========== ========== ========== - ** Gregorian 1912/02/18 2051/02/10 - ** TaiwanLunisolar 1912/01/01 2050/13/29 + ** Calendar Minimum Maximum + ** ========== ========== ========== + ** Gregorian 1912/02/18 2051/02/10 + ** TaiwanLunisolar 1912/01/01 2050/13/29 */ [Serializable] diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/ThaiBuddhistCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs similarity index 100% rename from src/coreclr/src/mscorlib/src/System/Globalization/ThaiBuddhistCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/TimeSpanStyles.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/TimeSpanStyles.cs similarity index 100% rename from src/coreclr/src/mscorlib/src/System/Globalization/TimeSpanStyles.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/TimeSpanStyles.cs diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/UmAlQuraCalendar.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs similarity index 99% rename from src/coreclr/src/mscorlib/src/System/Globalization/UmAlQuraCalendar.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs index 7b47d9c..b7ba6d0 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/UmAlQuraCalendar.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs @@ -7,11 +7,6 @@ using System.Diagnostics.Contracts; namespace System.Globalization { - //////////////////////////////////////////////////////////////////////////// - // - // Notes about UmAlQuraCalendar - // - //////////////////////////////////////////////////////////////////////////// /* ** Calendar support range: ** Calendar Minimum Maximum diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/UnicodeCategory.cs b/src/coreclr/src/mscorlib/shared/System/Globalization/UnicodeCategory.cs similarity index 95% rename from src/coreclr/src/mscorlib/src/System/Globalization/UnicodeCategory.cs rename to src/coreclr/src/mscorlib/shared/System/Globalization/UnicodeCategory.cs index 1c5e6bc..f0ae1fd 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/UnicodeCategory.cs +++ b/src/coreclr/src/mscorlib/shared/System/Globalization/UnicodeCategory.cs @@ -4,67 +4,37 @@ namespace System.Globalization { - [Serializable] public enum UnicodeCategory { UppercaseLetter = 0, - LowercaseLetter = 1, - TitlecaseLetter = 2, - ModifierLetter = 3, - OtherLetter = 4, - NonSpacingMark = 5, - SpacingCombiningMark = 6, - EnclosingMark = 7, - DecimalDigitNumber = 8, - LetterNumber = 9, - OtherNumber = 10, - SpaceSeparator = 11, - LineSeparator = 12, - ParagraphSeparator = 13, - Control = 14, - Format = 15, - Surrogate = 16, - PrivateUse = 17, - ConnectorPunctuation = 18, - DashPunctuation = 19, - OpenPunctuation = 20, - ClosePunctuation = 21, - InitialQuotePunctuation = 22, - FinalQuotePunctuation = 23, - OtherPunctuation = 24, - MathSymbol = 25, - CurrencySymbol = 26, - ModifierSymbol = 27, - OtherSymbol = 28, - OtherNotAssigned = 29, } } diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/Calendar.cs b/src/coreclr/src/mscorlib/src/System/Globalization/Calendar.cs index 422b72a..c23e108 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/Calendar.cs +++ b/src/coreclr/src/mscorlib/src/System/Globalization/Calendar.cs @@ -839,7 +839,7 @@ namespace System.Globalization CultureInfo.InvariantCulture, SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1))); } - return InternalGloablizationHelper.TimeToTicks(hour, minute, second) + millisecond * TicksPerMillisecond; + return InternalGlobalizationHelper.TimeToTicks(hour, minute, second) + millisecond * TicksPerMillisecond; } throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadHourMinuteSecond); } diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/CultureTypes.cs b/src/coreclr/src/mscorlib/src/System/Globalization/CultureTypes.cs deleted file mode 100644 index 10d9246..0000000 --- a/src/coreclr/src/mscorlib/src/System/Globalization/CultureTypes.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -// The enumeration constants used in CultureInfo.GetCultures(). -// On Linux platforms, the only enum values used there is NeutralCultures and SpecificCultures -// the rest are obsolete or not valid on Linux - -namespace System.Globalization -{ - [Serializable] - [Flags] - public enum CultureTypes - { - NeutralCultures = 0x0001, // Neutral cultures are cultures like "en", "de", "zh", etc, for enumeration this includes ALL neutrals regardless of other flags - SpecificCultures = 0x0002, // Non-netural cultuers. Examples are "en-us", "zh-tw", etc., for enumeration this includes ALL specifics regardless of other flags - InstalledWin32Cultures = 0x0004, // Win32 installed cultures in the system and exists in the framework too., this is effectively all cultures - - AllCultures = NeutralCultures | SpecificCultures | InstalledWin32Cultures, - - UserCustomCulture = 0x0008, // User defined custom culture - ReplacementCultures = 0x0010, // User defined replacement custom culture. - [Obsolete("This value has been deprecated. Please use other values in CultureTypes.")] - WindowsOnlyCultures = 0x0020, // this will always return empty list. - [Obsolete("This value has been deprecated. Please use other values in CultureTypes.")] - FrameworkCultures = 0x0040, // will return only the v2 cultures marked as Framework culture. - } -} diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs b/src/coreclr/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs index ee8ba13..bdc35f0 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs +++ b/src/coreclr/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs @@ -315,7 +315,7 @@ namespace System.Globalization 0, MillisPerSecond - 1)); } - return (InternalGloablizationHelper.TimeToTicks(hour, minute, second) + millisecond * TicksPerMillisecond); ; + return (InternalGlobalizationHelper.TimeToTicks(hour, minute, second) + millisecond * TicksPerMillisecond); ; } throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadHourMinuteSecond); } -- 2.7.4