Imported Upstream version 4.8.0.309

Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-11-10 13:04:39 +00:00
parent ee1447783b
commit 94b2861243
4912 changed files with 390737 additions and 49310 deletions

View File

@ -116,6 +116,9 @@ namespace System.Globalization
const int CalendarTypeBits = 8;
const string MSG_READONLY = "This instance is read only";
static volatile CultureInfo s_DefaultThreadCurrentUICulture;
static volatile CultureInfo s_DefaultThreadCurrentCulture;
public static CultureInfo InvariantCulture {
get {
@ -128,7 +131,7 @@ namespace System.Globalization
return Thread.CurrentThread.CurrentCulture;
}
set {
throw new NotImplementedException ();
Thread.CurrentThread.CurrentCulture = value;
}
}
@ -137,7 +140,7 @@ namespace System.Globalization
return Thread.CurrentThread.CurrentUICulture;
}
set {
throw new NotImplementedException ();
Thread.CurrentThread.CurrentUICulture = value;
}
}
@ -177,7 +180,6 @@ namespace System.Globalization
get { return territory; }
}
#if !NET_2_1
// FIXME: It is implemented, but would be hell slow.
[ComVisible (false)]
public CultureTypes CultureTypes {
@ -263,7 +265,6 @@ namespace System.Globalization
}
}
}
#endif
public virtual int LCID {
get {
@ -511,7 +512,7 @@ namespace System.Globalization
}
}
internal void CheckNeutral ()
void CheckNeutral ()
{
}
@ -1070,19 +1071,19 @@ namespace System.Globalization
public static CultureInfo DefaultThreadCurrentCulture {
get {
return Thread.default_culture;
return s_DefaultThreadCurrentCulture;
}
set {
Thread.default_culture = value;
s_DefaultThreadCurrentCulture = value;
}
}
public static CultureInfo DefaultThreadCurrentUICulture {
get {
return Thread.default_ui_culture;
return s_DefaultThreadCurrentUICulture;
}
set {
Thread.default_ui_culture = value;
s_DefaultThreadCurrentUICulture = value;
}
}
@ -1092,6 +1093,19 @@ namespace System.Globalization
}
}
internal static CultureInfo UserDefaultUICulture {
get {
return ConstructCurrentUICulture ();
}
}
internal static CultureInfo UserDefaultCulture {
get {
return ConstructCurrentCulture ();
}
}
#region reference sources
// TODO:
internal static readonly bool IsTaiwanSku;
@ -1144,6 +1158,19 @@ namespace System.Globalization
return true;
}
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) {
return true;
}
return VerifyCultureName(culture.Name, throwException);
}
#endregion
}
}