Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@@ -34,14 +34,13 @@ using System.Collections.Generic;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Diagnostics.Contracts;
namespace System.Globalization
{
[System.Runtime.InteropServices.ComVisible (true)]
[Serializable]
[StructLayout (LayoutKind.Sequential)]
public class CultureInfo : ICloneable, IFormatProvider
public partial class CultureInfo : ICloneable, IFormatProvider
{
static volatile CultureInfo invariant_culture_info = new CultureInfo (InvariantCultureId, false, true);
static object shared_table_lock = new object ();
@@ -112,6 +111,10 @@ namespace System.Globalization
[NonSerialized]internal CultureData m_cultureData;
[NonSerialized]internal bool m_isInherited;
// adapters for .NET Core sources (DateTimeFormatInfo) to reduce diff in mono/corefx repository
internal CultureData _cultureData => m_cultureData;
internal bool _isInherited => m_isInherited;
internal const int InvariantCultureId = 0x7F;
const int CalendarTypeBits = 8;
@@ -307,7 +310,9 @@ namespace System.Globalization
}
}
#if !NETCORE
[MonoLimitation ("Optional calendars are not supported only default calendar is returned")]
#endif
public virtual Calendar[] OptionalCalendars {
get {
return new[] { Calendar };
@@ -551,7 +556,7 @@ namespace System.Globalization
CheckNeutral ();
var temp = new DateTimeFormatInfo (m_cultureData, Calendar);
temp.m_isReadOnly = m_isReadOnly;
temp._isReadOnly = m_isReadOnly;
System.Threading.Thread.MemoryBarrier();
dateTimeInfo = temp;
return dateTimeInfo;
@@ -776,7 +781,9 @@ namespace System.Globalization
}
}
#if !NETCORE
[MonoTODO ("Currently it ignores the altName parameter")]
#endif
public static CultureInfo GetCultureInfo (string name, string altName) {
if (name == null)
throw new ArgumentNullException ("null");
@@ -1130,7 +1137,6 @@ namespace System.Globalization
obj.GetType(),
container.GetType()));
}
Contract.EndContractBlock();
}
// For resource lookup, we consider a culture the invariant culture by name equality.
@@ -1163,8 +1169,6 @@ namespace System.Globalization
}
internal static bool VerifyCultureName(CultureInfo culture, bool throwException) {
Contract.Assert(culture!=null, "[CultureInfo.VerifyCultureName]culture!=null");
//If we have an instance of one of our CultureInfos, the user can't have changed the
//name and we know that all names are valid in files.
if (!culture.m_isInherited) {