using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace System.Globalization { /// Contains information about the country/region. // Token: 0x02000195 RID: 405 [ComVisible(true)] [Serializable] public class RegionInfo { /// Initializes a new instance of the class based on the country/region associated with the specified culture identifier. /// A culture identifier. /// /// specifies either an invariant, custom, or neutral culture. // 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"); } } /// Initializes a new instance of the class based on the country/region or specific culture, specified by 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. /// /// is null. /// /// is not a valid country/region name or specific culture name. // 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"); } } /// Gets the that represents the country/region used by the current thread. /// The that represents the country/region used by the current thread. // 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); /// Gets the name, in English, of the currency used in the country/region. /// The name, in English, of the currency used in the country/region. // Token: 0x17000399 RID: 921 // (get) Token: 0x0600148C RID: 5260 RVA: 0x0004F550 File Offset: 0x0004D750 [ComVisible(false)] public virtual string CurrencyEnglishName { get { return this.currencyEnglishName; } } /// Gets the currency symbol associated with the country/region. /// The currency symbol associated with the country/region. // Token: 0x1700039A RID: 922 // (get) Token: 0x0600148D RID: 5261 RVA: 0x0004F558 File Offset: 0x0004D758 public virtual string CurrencySymbol { get { return this.currencySymbol; } } /// Gets the full name of the country/region in the language of the localized version of .NET Framework. /// The full name of the country/region in the language of the localized version of .NET Framework. // 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; } } /// Gets the full name of the country/region in English. /// The full name of the country/region in English. // Token: 0x1700039C RID: 924 // (get) Token: 0x0600148F RID: 5263 RVA: 0x0004F568 File Offset: 0x0004D768 public virtual string EnglishName { get { return this.englishName; } } /// Gets a unique identification number for a geographical region, country, city, or location. /// A 32-bit signed number that uniquely identifies a geographical location. // Token: 0x1700039D RID: 925 // (get) Token: 0x06001490 RID: 5264 RVA: 0x0004F570 File Offset: 0x0004D770 [ComVisible(false)] public virtual int GeoId { get { return this.regionId; } } /// Gets a value indicating whether the country/region uses the metric system for measurements. /// true if the country/region uses the metric system for measurements; otherwise, false. // 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(2) { { "US", 0 }, { "UK", 0 } }; } int num; if (RegionInfo.<>f__switch$map1B.TryGetValue(text, out num)) { if (num == 0) { return false; } } } return true; } } /// Gets the three-character ISO 4217 currency symbol associated with the country/region. /// The three-character ISO 4217 currency symbol associated with the country/region. // Token: 0x1700039F RID: 927 // (get) Token: 0x06001492 RID: 5266 RVA: 0x0004F5E4 File Offset: 0x0004D7E4 public virtual string ISOCurrencySymbol { get { return this.isoCurrencySymbol; } } /// Gets the name of a country/region formatted in the native language of the country/region. /// The native name of the country/region formatted in the language associated with the ISO 3166 country/region code. // Token: 0x170003A0 RID: 928 // (get) Token: 0x06001493 RID: 5267 RVA: 0x0004F5EC File Offset: 0x0004D7EC [ComVisible(false)] public virtual string NativeName { get { return this.DisplayName; } } /// Gets the name of the currency used in the country/region, formatted in the native language of the country/region. /// The native name of the currency used in the country/region, formatted in the language associated with the ISO 3166 country/region code. // 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(); } } /// Gets the name or ISO 3166 two-letter country/region code for the current object. /// The value specified by the parameter of the constructor. The return value is in uppercase.-or-The two-letter code defined in ISO 3166 for the country/region specified by the parameter of the constructor. The return value is in uppercase. // Token: 0x170003A2 RID: 930 // (get) Token: 0x06001495 RID: 5269 RVA: 0x0004F5FC File Offset: 0x0004D7FC public virtual string Name { get { return this.iso2Name; } } /// Gets the three-letter code defined in ISO 3166 for the country/region. /// The three-letter code defined in ISO 3166 for the country/region. // Token: 0x170003A3 RID: 931 // (get) Token: 0x06001496 RID: 5270 RVA: 0x0004F604 File Offset: 0x0004D804 public virtual string ThreeLetterISORegionName { get { return this.iso3Name; } } /// Gets the three-letter code assigned by Windows to the country/region represented by this . /// The three-letter code assigned by Windows to the country/region represented by this . // Token: 0x170003A4 RID: 932 // (get) Token: 0x06001497 RID: 5271 RVA: 0x0004F60C File Offset: 0x0004D80C public virtual string ThreeLetterWindowsRegionName { get { return this.win3Name; } } /// Gets the two-letter code defined in ISO 3166 for the country/region. /// The two-letter code defined in ISO 3166 for the country/region. // Token: 0x170003A5 RID: 933 // (get) Token: 0x06001498 RID: 5272 RVA: 0x0004F614 File Offset: 0x0004D814 public virtual string TwoLetterISORegionName { get { return this.iso2Name; } } /// Determines whether the specified object is the same instance as the current . /// true if the parameter is a object and its property is the same as the property of the current object; otherwise, false. /// The object to compare with the current . // 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; } /// Serves as a hash function for the current , suitable for hashing algorithms and data structures, such as a hash table. /// A hash code for the current . // 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)); } /// Returns a string containing the culture name or ISO 3166 two-letter country/region codes specified for the current . /// A string containing the culture name or ISO 3166 two-letter country/region codes defined for the current . // 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; } }