This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
+329
View File
@@ -0,0 +1,329 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Globalization
{
/// <summary>Contains information about the country/region.</summary>
// Token: 0x02000195 RID: 405
[ComVisible(true)]
[Serializable]
public class RegionInfo
{
/// <summary>Initializes a new instance of the <see cref="T:System.Globalization.RegionInfo" /> class based on the country/region associated with the specified culture identifier.</summary>
/// <param name="culture">A culture identifier. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="culture" /> specifies either an invariant, custom, or neutral culture.</exception>
// Token: 0x06001487 RID: 5255 RVA: 0x0004F410 File Offset: 0x0004D610
public RegionInfo(int culture)
{
if (!this.GetByTerritory(CultureInfo.GetCultureInfo(culture)))
{
throw new ArgumentException(string.Format("Region ID {0} (0x{0:X4}) is not a supported region.", culture), "culture");
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Globalization.RegionInfo" /> class based on the country/region or specific culture, specified by name.</summary>
/// <param name="name">A string containing one of the two-letter codes defined in ISO 3166 for country/region.-or-Beginning in .NET Framework version 2.0, a string containing the culture name for a specific culture, custom culture, or Windows-only culture. If the culture name is not in RFC 4646 format, your application should specify the entire culture name, not just the country/region. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> is not a valid country/region name or specific culture name.</exception>
// Token: 0x06001488 RID: 5256 RVA: 0x0004F450 File Offset: 0x0004D650
public RegionInfo(string name)
{
if (name == null)
{
throw new ArgumentNullException();
}
if (this.construct_internal_region_from_name(name.ToUpperInvariant()))
{
this.lcid = name.GetHashCode();
return;
}
if (!this.GetByTerritory(CultureInfo.GetCultureInfo(name)))
{
throw new ArgumentException(string.Format("Region name {0} is not supported.", name), "name");
}
}
/// <summary>Gets the <see cref="T:System.Globalization.RegionInfo" /> that represents the country/region used by the current thread.</summary>
/// <returns>The <see cref="T:System.Globalization.RegionInfo" /> that represents the country/region used by the current thread.</returns>
// Token: 0x17000398 RID: 920
// (get) Token: 0x06001489 RID: 5257 RVA: 0x0004F4B4 File Offset: 0x0004D6B4
public static RegionInfo CurrentRegion
{
get
{
if (RegionInfo.currentRegion == null)
{
CultureInfo currentCulture = CultureInfo.CurrentCulture;
if (currentCulture == null || CultureInfo.BootstrapCultureID == 127)
{
return null;
}
RegionInfo.currentRegion = new RegionInfo(CultureInfo.BootstrapCultureID);
}
return RegionInfo.currentRegion;
}
}
// Token: 0x0600148A RID: 5258 RVA: 0x0004F4FC File Offset: 0x0004D6FC
private bool GetByTerritory(CultureInfo ci)
{
if (ci == null)
{
throw new Exception("INTERNAL ERROR: should not happen.");
}
if (ci.IsNeutralCulture || ci.Territory == null)
{
return false;
}
this.lcid = ci.LCID;
return this.construct_internal_region_from_name(ci.Territory.ToUpperInvariant());
}
// Token: 0x0600148B RID: 5259
[MethodImpl(MethodImplOptions.InternalCall)]
private extern bool construct_internal_region_from_name(string name);
/// <summary>Gets the name, in English, of the currency used in the country/region.</summary>
/// <returns>The name, in English, of the currency used in the country/region.</returns>
// Token: 0x17000399 RID: 921
// (get) Token: 0x0600148C RID: 5260 RVA: 0x0004F550 File Offset: 0x0004D750
[ComVisible(false)]
public virtual string CurrencyEnglishName
{
get
{
return this.currencyEnglishName;
}
}
/// <summary>Gets the currency symbol associated with the country/region.</summary>
/// <returns>The currency symbol associated with the country/region.</returns>
// Token: 0x1700039A RID: 922
// (get) Token: 0x0600148D RID: 5261 RVA: 0x0004F558 File Offset: 0x0004D758
public virtual string CurrencySymbol
{
get
{
return this.currencySymbol;
}
}
/// <summary>Gets the full name of the country/region in the language of the localized version of .NET Framework.</summary>
/// <returns>The full name of the country/region in the language of the localized version of .NET Framework.</returns>
// Token: 0x1700039B RID: 923
// (get) Token: 0x0600148E RID: 5262 RVA: 0x0004F560 File Offset: 0x0004D760
[MonoTODO("DisplayName currently only returns the EnglishName")]
public virtual string DisplayName
{
get
{
return this.englishName;
}
}
/// <summary>Gets the full name of the country/region in English.</summary>
/// <returns>The full name of the country/region in English.</returns>
// Token: 0x1700039C RID: 924
// (get) Token: 0x0600148F RID: 5263 RVA: 0x0004F568 File Offset: 0x0004D768
public virtual string EnglishName
{
get
{
return this.englishName;
}
}
/// <summary>Gets a unique identification number for a geographical region, country, city, or location.</summary>
/// <returns>A 32-bit signed number that uniquely identifies a geographical location.</returns>
// Token: 0x1700039D RID: 925
// (get) Token: 0x06001490 RID: 5264 RVA: 0x0004F570 File Offset: 0x0004D770
[ComVisible(false)]
public virtual int GeoId
{
get
{
return this.regionId;
}
}
/// <summary>Gets a value indicating whether the country/region uses the metric system for measurements.</summary>
/// <returns>true if the country/region uses the metric system for measurements; otherwise, false.</returns>
// Token: 0x1700039E RID: 926
// (get) Token: 0x06001491 RID: 5265 RVA: 0x0004F578 File Offset: 0x0004D778
public virtual bool IsMetric
{
get
{
string text = this.iso2Name;
if (text != null)
{
if (RegionInfo.<>f__switch$map1B == null)
{
RegionInfo.<>f__switch$map1B = new Dictionary<string, int>(2)
{
{ "US", 0 },
{ "UK", 0 }
};
}
int num;
if (RegionInfo.<>f__switch$map1B.TryGetValue(text, out num))
{
if (num == 0)
{
return false;
}
}
}
return true;
}
}
/// <summary>Gets the three-character ISO 4217 currency symbol associated with the country/region.</summary>
/// <returns>The three-character ISO 4217 currency symbol associated with the country/region.</returns>
// Token: 0x1700039F RID: 927
// (get) Token: 0x06001492 RID: 5266 RVA: 0x0004F5E4 File Offset: 0x0004D7E4
public virtual string ISOCurrencySymbol
{
get
{
return this.isoCurrencySymbol;
}
}
/// <summary>Gets the name of a country/region formatted in the native language of the country/region.</summary>
/// <returns>The native name of the country/region formatted in the language associated with the ISO 3166 country/region code. </returns>
// Token: 0x170003A0 RID: 928
// (get) Token: 0x06001493 RID: 5267 RVA: 0x0004F5EC File Offset: 0x0004D7EC
[ComVisible(false)]
public virtual string NativeName
{
get
{
return this.DisplayName;
}
}
/// <summary>Gets the name of the currency used in the country/region, formatted in the native language of the country/region. </summary>
/// <returns>The native name of the currency used in the country/region, formatted in the language associated with the ISO 3166 country/region code. </returns>
// Token: 0x170003A1 RID: 929
// (get) Token: 0x06001494 RID: 5268 RVA: 0x0004F5F4 File Offset: 0x0004D7F4
[ComVisible(false)]
[MonoTODO("Not implemented")]
public virtual string CurrencyNativeName
{
get
{
throw new NotImplementedException();
}
}
/// <summary>Gets the name or ISO 3166 two-letter country/region code for the current <see cref="T:System.Globalization.RegionInfo" /> object.</summary>
/// <returns>The value specified by the <paramref name="name" /> parameter of the <see cref="M:System.Globalization.RegionInfo.#ctor(System.String)" /> constructor. The return value is in uppercase.-or-The two-letter code defined in ISO 3166 for the country/region specified by the <paramref name="culture" /> parameter of the <see cref="M:System.Globalization.RegionInfo.#ctor(System.Int32)" /> constructor. The return value is in uppercase.</returns>
// Token: 0x170003A2 RID: 930
// (get) Token: 0x06001495 RID: 5269 RVA: 0x0004F5FC File Offset: 0x0004D7FC
public virtual string Name
{
get
{
return this.iso2Name;
}
}
/// <summary>Gets the three-letter code defined in ISO 3166 for the country/region.</summary>
/// <returns>The three-letter code defined in ISO 3166 for the country/region.</returns>
// Token: 0x170003A3 RID: 931
// (get) Token: 0x06001496 RID: 5270 RVA: 0x0004F604 File Offset: 0x0004D804
public virtual string ThreeLetterISORegionName
{
get
{
return this.iso3Name;
}
}
/// <summary>Gets the three-letter code assigned by Windows to the country/region represented by this <see cref="T:System.Globalization.RegionInfo" />.</summary>
/// <returns>The three-letter code assigned by Windows to the country/region represented by this <see cref="T:System.Globalization.RegionInfo" />.</returns>
// Token: 0x170003A4 RID: 932
// (get) Token: 0x06001497 RID: 5271 RVA: 0x0004F60C File Offset: 0x0004D80C
public virtual string ThreeLetterWindowsRegionName
{
get
{
return this.win3Name;
}
}
/// <summary>Gets the two-letter code defined in ISO 3166 for the country/region.</summary>
/// <returns>The two-letter code defined in ISO 3166 for the country/region.</returns>
// Token: 0x170003A5 RID: 933
// (get) Token: 0x06001498 RID: 5272 RVA: 0x0004F614 File Offset: 0x0004D814
public virtual string TwoLetterISORegionName
{
get
{
return this.iso2Name;
}
}
/// <summary>Determines whether the specified object is the same instance as the current <see cref="T:System.Globalization.RegionInfo" />.</summary>
/// <returns>true if the <paramref name="value" /> parameter is a <see cref="T:System.Globalization.RegionInfo" /> object and its <see cref="P:System.Globalization.RegionInfo.Name" /> property is the same as the <see cref="P:System.Globalization.RegionInfo.Name" /> property of the current <see cref="T:System.Globalization.RegionInfo" /> object; otherwise, false.</returns>
/// <param name="value">The object to compare with the current <see cref="T:System.Globalization.RegionInfo" />. </param>
// Token: 0x06001499 RID: 5273 RVA: 0x0004F61C File Offset: 0x0004D81C
public override bool Equals(object value)
{
RegionInfo regionInfo = value as RegionInfo;
return regionInfo != null && this.lcid == regionInfo.lcid;
}
/// <summary>Serves as a hash function for the current <see cref="T:System.Globalization.RegionInfo" />, suitable for hashing algorithms and data structures, such as a hash table.</summary>
/// <returns>A hash code for the current <see cref="T:System.Globalization.RegionInfo" />.</returns>
// Token: 0x0600149A RID: 5274 RVA: 0x0004F648 File Offset: 0x0004D848
public override int GetHashCode()
{
return (int)((ulong)int.MinValue + (ulong)((long)((long)this.regionId << 3)) + (ulong)((long)this.regionId));
}
/// <summary>Returns a string containing the culture name or ISO 3166 two-letter country/region codes specified for the current <see cref="T:System.Globalization.RegionInfo" />.</summary>
/// <returns>A string containing the culture name or ISO 3166 two-letter country/region codes defined for the current <see cref="T:System.Globalization.RegionInfo" />.</returns>
// Token: 0x0600149B RID: 5275 RVA: 0x0004F664 File Offset: 0x0004D864
public override string ToString()
{
return this.Name;
}
// Token: 0x040005CD RID: 1485
private static RegionInfo currentRegion;
// Token: 0x040005CE RID: 1486
private int lcid;
// Token: 0x040005CF RID: 1487
private int regionId;
// Token: 0x040005D0 RID: 1488
private string iso2Name;
// Token: 0x040005D1 RID: 1489
private string iso3Name;
// Token: 0x040005D2 RID: 1490
private string win3Name;
// Token: 0x040005D3 RID: 1491
private string englishName;
// Token: 0x040005D4 RID: 1492
private string currencySymbol;
// Token: 0x040005D5 RID: 1493
private string isoCurrencySymbol;
// Token: 0x040005D6 RID: 1494
private string currencyEnglishName;
}
}