Expose missing Global/Encoding APIs in coreclr and remove empty stubs
[platform/upstream/coreclr.git] / src / mscorlib / src / System / Globalization / RegionInfo.cs
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4
5
6 ////////////////////////////////////////////////////////////////////////////
7 //
8 //
9 //  Purpose:  This class represents settings specified by de jure or
10 //            de facto standards for a particular country/region.  In
11 //            contrast to CultureInfo, the RegionInfo does not represent
12 //            preferences of the user and does not depend on the user's
13 //            language or culture.
14 //
15 //
16 ////////////////////////////////////////////////////////////////////////////
17
18 namespace System.Globalization {
19
20     using System;
21     using System.Runtime.Serialization;
22     using System.Diagnostics.Contracts;
23
24     [Serializable] 
25     [System.Runtime.InteropServices.ComVisible(true)]
26     public partial class RegionInfo
27     {
28         //--------------------------------------------------------------------//
29         //                        Internal Information                        //
30         //--------------------------------------------------------------------//
31
32         //
33         //  Variables.
34         //
35
36         //
37         // Name of this region (ie: es-US): serialized, the field used for deserialization
38         //
39         internal String m_name;
40
41         //
42         // The CultureData instance that we are going to read data from.
43         //
44         [NonSerialized]internal CultureData m_cultureData;
45
46         //
47         // The RegionInfo for our current region
48         //
49         internal static volatile RegionInfo s_currentRegionInfo;
50
51
52         ////////////////////////////////////////////////////////////////////////
53         //
54         //  RegionInfo Constructors
55         //
56         //  Note: We prefer that a region be created with a full culture name (ie: en-US)
57         //  because otherwise the native strings won't be right.
58         //
59         //  In Silverlight we enforce that RegionInfos must be created with a full culture name
60         //
61         ////////////////////////////////////////////////////////////////////////
62         [System.Security.SecuritySafeCritical]  // auto-generated
63         public RegionInfo(String name) {
64             if (name==null)
65                 throw new ArgumentNullException("name");
66
67             if (name.Length == 0) //The InvariantCulture has no matching region
68             { 
69                 throw new ArgumentException(Environment.GetResourceString("Argument_NoRegionInvariantCulture"), "name");
70             }
71             
72             Contract.EndContractBlock();
73
74             //
75             // First try it as an entire culture. We must have user override as true here so
76             // that we can pick up custom cultures *before* built-in ones (if they want to
77             // prefer built-in cultures they will pass "us" instead of "en-US").
78             //
79             this.m_cultureData = CultureData.GetCultureDataForRegion(name,true);
80             // this.m_name = name.ToUpper(CultureInfo.InvariantCulture);
81
82             if (this.m_cultureData == null)
83                 throw new ArgumentException(
84                     String.Format(
85                         CultureInfo.CurrentCulture,
86                         Environment.GetResourceString("Argument_InvalidCultureName"), name), "name");
87
88
89             // Not supposed to be neutral
90             if (this.m_cultureData.IsNeutralCulture)
91                 throw new ArgumentException(Environment.GetResourceString("Argument_InvalidNeutralRegionName", name), "name");
92
93             SetName(name);
94         }
95
96 #if FEATURE_USE_LCID
97         // We'd rather people use the named version since this doesn't allow custom locales
98         [System.Security.SecuritySafeCritical]  // auto-generated
99         public RegionInfo(int culture)
100         {
101             if (culture == CultureInfo.LOCALE_INVARIANT) //The InvariantCulture has no matching region
102             { 
103                 throw new ArgumentException(Environment.GetResourceString("Argument_NoRegionInvariantCulture"));
104             }
105             
106             if (culture == CultureInfo.LOCALE_NEUTRAL)
107             {
108                 // Not supposed to be neutral
109                 throw new ArgumentException(Environment.GetResourceString("Argument_CultureIsNeutral", culture), "culture");
110             }
111
112             if (culture == CultureInfo.LOCALE_CUSTOM_DEFAULT)
113             {
114                 // Not supposed to be neutral
115                 throw new ArgumentException(Environment.GetResourceString("Argument_CustomCultureCannotBePassedByNumber", culture), "culture");
116             }
117             
118             this.m_cultureData = CultureData.GetCultureData(culture,true);
119             this.m_name = this.m_cultureData.SREGIONNAME;
120
121             if (this.m_cultureData.IsNeutralCulture)
122             {
123                 // Not supposed to be neutral
124                 throw new ArgumentException(Environment.GetResourceString("Argument_CultureIsNeutral", culture), "culture");
125             }
126             m_cultureId = culture;
127         }
128 #endif
129         
130         [System.Security.SecuritySafeCritical]  // auto-generated
131         internal RegionInfo(CultureData cultureData)
132         {
133             this.m_cultureData = cultureData;
134             this.m_name = this.m_cultureData.SREGIONNAME;
135         }
136
137         [System.Security.SecurityCritical]  // auto-generated
138         private void SetName(string name)
139         {
140 #if FEATURE_CORECLR
141             // Use the name of the region we found
142             this.m_name = this.m_cultureData.SREGIONNAME;
143 #else
144             // when creating region by culture name, we keep the region name as the culture name so regions
145             // created by custom culture names can be differentiated from built in regions.
146             this.m_name = name.Equals(this.m_cultureData.SREGIONNAME, StringComparison.OrdinalIgnoreCase) ? 
147                                 this.m_cultureData.SREGIONNAME : 
148                                 this.m_cultureData.CultureName;
149 #endif // FEATURE_CORECLR
150         }
151         
152
153 #region Serialization 
154         //
155         //  m_cultureId is needed for serialization only to detect the case if the region info is created using the name or using the LCID.
156         //  in case m_cultureId is zero means that the RigionInfo is created using name. otherwise it is created using LCID.
157         //
158
159         [OptionalField(VersionAdded = 2)]
160         int m_cultureId;
161         // the following field is defined to keep the compatibility with Everett.
162         // don't change/remove the names/types of these field.
163         [OptionalField(VersionAdded = 2)]
164         internal int m_dataItem = 0;
165
166 #if !FEATURE_CORECLR
167         static private readonly int[] IdFromEverettRegionInfoDataItem =
168         {
169             0x3801, /*  0 */  // AE          ar-AE      Arabic (U.A.E.)
170             0x041C, /*  1 */  // AL          sq-AL      Albanian (Albania)
171             0x042B, /*  2 */  // AM          hy-AM      Armenian (Armenia)
172             0x2C0A, /*  3 */  // AR          es-AR      Spanish (Argentina)
173             0x0C07, /*  4 */  // AT          de-AT      German (Austria)
174             0x0C09, /*  5 */  // AU          en-AU      English (Australia)
175             0x042C, /*  6 */  // AZ          az-AZ-Latn Azeri (Latin) (Azerbaijan)
176         //  0x082C,     6,    // AZ          az-AZ-Cyrl Azeri (Cyrillic) (Azerbaijan)
177             0x080C, /*  7 */  // BE          fr-BE      French (Belgium)
178         //  0x0813,     7,    // BE          nl-BE      Dutch (Belgium)
179             0x0402, /*  8 */  // BG          bg-BG      Bulgarian (Bulgaria)
180             0x3C01, /*  9 */  // BH          ar-BH      Arabic (Bahrain)
181             0x083E, /* 10 */  // BN          ms-BN      Malay (Brunei Darussalam)
182             0x400A, /* 11 */  // BO          es-BO      Spanish (Bolivia)
183             0x0416, /* 12 */  // BR          pt-BR      Portuguese (Brazil)
184             0x0423, /* 13 */  // BY          be-BY      Belarusian (Belarus)
185             0x2809, /* 14 */  // BZ          en-BZ      English (Belize)
186             0x0C0C, /* 15 */  // CA          fr-CA      French (Canada)
187         //  0x1009,    15,    // CA          en-CA      English (Canada)
188             0x2409, /* 16 */  // CB          en-CB      English (Caribbean)
189             0x0807, /* 17 */  // CH          de-CH      German (Switzerland)
190         //  0x0810,    17,    // CH          it-CH      Italian (Switzerland)
191         //  0x100C,    17,    // CH          fr-CH      French (Switzerland)
192             0x340A, /* 18 */  // CL          es-CL      Spanish (Chile)
193             0x0804, /* 19 */  // CN          zh-CN      Chinese (People's Republic of China)
194             0x240A, /* 20 */  // CO          es-CO      Spanish (Colombia)
195             0x140A, /* 21 */  // CR          es-CR      Spanish (Costa Rica)
196             0x0405, /* 22 */  // CZ          cs-CZ      Czech (Czech Republic)
197             0x0407, /* 23 */  // DE          de-DE      German (Germany)
198             0x0406, /* 24 */  // DK          da-DK      Danish (Denmark)
199             0x1C0A, /* 25 */  // DO          es-DO      Spanish (Dominican Republic)
200             0x1401, /* 26 */  // DZ          ar-DZ      Arabic (Algeria)
201             0x300A, /* 27 */  // EC          es-EC      Spanish (Ecuador)
202             0x0425, /* 28 */  // EE          et-EE      Estonian (Estonia)
203             0x0C01, /* 29 */  // EG          ar-EG      Arabic (Egypt)
204             0x0403, /* 30 */  // ES          ca-ES      Catalan (Catalan)
205         //  0x042D,    30,    // ES          eu-ES      Basque (Basque)
206         //  0x0456,    30,    // ES          gl-ES      Galician (Galician)
207         //  0x0C0A,    30,    // ES          es-ES      Spanish (Spain)
208             0x040B, /* 31 */  // FI          fi-FI      Finnish (Finland)
209         //  0x081D,    31,    // FI          sv-FI      Swedish (Finland)
210             0x0438, /* 32 */  // FO          fo-FO      Faroese (Faroe Islands)
211             0x040C, /* 33 */  // FR          fr-FR      French (France)
212             0x0809, /* 34 */  // GB          en-GB      English (United Kingdom)
213             0x0437, /* 35 */  // GE          ka-GE      Georgian (Georgia)
214             0x0408, /* 36 */  // GR          el-GR      Greek (Greece)
215             0x100A, /* 37 */  // GT          es-GT      Spanish (Guatemala)
216             0x0C04, /* 38 */  // HK          zh-HK      Chinese (Hong Kong S.A.R.)
217             0x480A, /* 39 */  // HN          es-HN      Spanish (Honduras)
218             0x041A, /* 40 */  // HR          hr-HR      Croatian (Croatia)
219             0x040E, /* 41 */  // HU          hu-HU      Hungarian (Hungary)
220             0x0421, /* 42 */  // ID          id-ID      Indonesian (Indonesia)
221             0x1809, /* 43 */  // IE          en-IE      English (Ireland)
222             0x040D, /* 44 */  // IL          he-IL      Hebrew (Israel)
223             0x0439, /* 45 */  // IN          hi-IN      Hindi (India)
224         //  0x0446,    45,    // IN          pa-IN      Punjabi (India)
225         //  0x0447,    45,    // IN          gu-IN      Gujarati (India)
226         //  0x0449,    45,    // IN          ta-IN      Tamil (India)
227         //  0x044A,    45,    // IN          te-IN      Telugu (India)
228         //  0x044B,    45,    // IN          kn-IN      Kannada (India)
229         //  0x044E,    45,    // IN          mr-IN      Marathi (India)
230         //  0x044F,    45,    // IN          sa-IN      Sanskrit (India)
231         //  0x0457,    45,    // IN          kok-IN     Konkani (India)
232             0x0801, /* 46 */  // IQ          ar-IQ      Arabic (Iraq)
233             0x0429, /* 47 */  // IR          fa-IR      (Iran)
234             0x040F, /* 48 */  // IS          is-IS      Icelandic (Iceland)
235             0x0410, /* 49 */  // IT          it-IT      Italian (Italy)
236             0x2009, /* 50 */  // JM          en-JM      English (Jamaica)
237             0x2C01, /* 51 */  // JO          ar-JO      Arabic (Jordan)
238             0x0411, /* 52 */  // JP          ja-JP      Japanese (Japan)
239             0x0441, /* 53 */  // KE          sw-KE      Swahili (Kenya)
240             0x0440, /* 54 */  // KG          ky-KG      Kyrgyz (Kyrgyzstan)
241             0x0412, /* 55 */  // KR          ko-KR      Korean (Korea)
242             0x3401, /* 56 */  // KW          ar-KW      Arabic (Kuwait)
243             0x043F, /* 57 */  // KZ          kk-KZ      Kazakh (Kazakhstan)
244             0x3001, /* 58 */  // LB          ar-LB      Arabic (Lebanon)
245             0x1407, /* 59 */  // LI          de-LI      German (Liechtenstein)
246             0x0427, /* 60 */  // LT          lt-LT      Lithuanian (Lithuania)
247             0x1007, /* 61 */  // LU          de-LU      German (Luxembourg)
248         //  0x140C,    61,    // LU          fr-LU      French (Luxembourg)
249             0x0426, /* 62 */  // LV          lv-LV      Latvian (Latvia)
250             0x1001, /* 63 */  // LY          ar-LY      Arabic (Libya)
251             0x1801, /* 64 */  // MA          ar-MA      Arabic (Morocco)
252             0x180C, /* 65 */  // MC          fr-MC      French (Principality of Monaco)
253             0x042F, /* 66 */  // MK          mk-MK      Macedonian (Macedonia, FYRO)
254             0x0450, /* 67 */  // MN          mn-MN      Mongolian (Mongolia)
255             0x1404, /* 68 */  // MO          zh-MO      Chinese (Macau S.A.R.)
256             0x0465, /* 69 */  // MV          div-MV     Divehi (Maldives)
257             0x080A, /* 70 */  // MX          es-MX      Spanish (Mexico)
258             0x043E, /* 71 */  // MY          ms-MY      Malay (Malaysia)
259             0x4C0A, /* 72 */  // NI          es-NI      Spanish (Nicaragua)
260             0x0413, /* 73 */  // NL          nl-NL      Dutch (Netherlands)
261             0x0414, /* 74 */  // NO          nb-NO      Norwegian (Bokm?) (Norway)
262         //  0x0814,    74,    // NO          nn-NO      Norwegian (Nynorsk) (Norway)
263             0x1409, /* 75 */  // NZ          en-NZ      English (New Zealand)
264             0x2001, /* 76 */  // OM          ar-OM      Arabic (Oman)
265             0x180A, /* 77 */  // PA          es-PA      Spanish (Panama)
266             0x280A, /* 78 */  // PE          es-PE      Spanish (Peru)
267             0x3409, /* 79 */  // PH          en-PH      English (Republic of the Philippines)
268             0x0420, /* 80 */  // PK          ur-PK      Urdu (Islamic Republic of Pakistan)
269             0x0415, /* 81 */  // PL          pl-PL      Polish (Poland)
270             0x500A, /* 82 */  // PR          es-PR      Spanish (Puerto Rico)
271             0x0816, /* 83 */  // PT          pt-PT      Portuguese (Portugal)
272             0x3C0A, /* 84 */  // PY          es-PY      Spanish (Paraguay)
273             0x4001, /* 85 */  // QA          ar-QA      Arabic (Qatar)
274             0x0418, /* 86 */  // RO          ro-RO      Romanian (Romania)
275             0x0419, /* 87 */  // RU          ru-RU      Russian (Russia)
276         //  0x0444,    87,    // RU          tt-RU      Tatar (Russia)
277             0x0401, /* 88 */  // SA          ar-SA      Arabic (Saudi Arabia)
278             0x041D, /* 89 */  // SE          sv-SE      Swedish (Sweden)
279             0x1004, /* 90 */  // SG          zh-SG      Chinese (Singapore)
280             0x0424, /* 91 */  // SI          sl-SI      Slovenian (Slovenia)
281             0x041B, /* 92 */  // SK          sk-SK      Slovak (Slovakia)
282             0x081A, /* 93 */  // SP          sr-SP-Latn Serbian (Latin) (Serbia)
283         //  0x0C1A,    93,    // SP          sr-SP-Cyrl Serbian (Cyrillic) (Serbia)
284             0x440A, /* 94 */  // SV          es-SV      Spanish (El Salvador)
285             0x045A, /* 95 */  // SY          syr-SY     Syriac (Syria)
286         //  0x2801,    95,    // SY          ar-SY      Arabic (Syria)
287             0x041E, /* 96 */  // TH          th-TH      Thai (Thailand)
288             0x1C01, /* 97 */  // TN          ar-TN      Arabic (Tunisia)
289             0x041F, /* 98 */  // TR          tr-TR      Turkish (Turkey)
290             0x2C09, /* 99 */  // TT          en-TT      English (Trinidad and Tobago)
291             0x0404, /*100 */  // TW          zh-TW      Chinese (Taiwan)
292             0x0422, /*101 */  // UA          uk-UA      Ukrainian (Ukraine)
293             0x0409, /*102 */  // US          en-US      English (United States)
294             0x380A, /*103 */  // UY          es-UY      Spanish (Uruguay)
295             0x0443, /*104 */  // UZ          uz-UZ-Latn Uzbek (Latin) (Uzbekistan)
296         //  0x0843,   104     // UZ          uz-UZ-Cyrl Uzbek (Cyrillic) (Uzbekistan)
297             0x200A, /*105*/   // VE          es-VE      Spanish (Venezuela)
298             0x042A, /*106*/   // VN          vi-VN      Vietnamese (Viet Nam)
299             0x2401, /*107*/   // YE          ar-YE      Arabic (Yemen)
300             0x0436, /*108*/   // ZA          af-ZA      Afrikaans (South Africa)
301         //  0x1C09,   108,    // ZA          en-ZA      English (South Africa)
302             0x3009, /*109*/   // ZW          en-ZW      English (Zimbabwe)
303         };
304 #endif
305         [System.Security.SecurityCritical]  // auto-generated
306         [OnDeserialized]
307         private void OnDeserialized(StreamingContext ctx)
308         {
309 #if FEATURE_CORECLR
310             // This won't happen anyway since CoreCLR doesn't support serialization
311             this.m_cultureData = CultureData.GetCultureData(m_name, true);
312 #else
313             if (m_name == null)
314             {
315                 Contract.Assert(m_dataItem >= 0, "[RegionInfo.OnDeserialized] null name and invalid dataItem");
316                 m_cultureId = IdFromEverettRegionInfoDataItem[m_dataItem];
317             }
318
319             if (m_cultureId == 0)
320             {
321                 this.m_cultureData = CultureData.GetCultureDataForRegion(this.m_name, true);
322             }
323             else
324             {
325                 this.m_cultureData = CultureData.GetCultureData(m_cultureId, true);
326             }
327                 
328 #endif
329             if (this.m_cultureData == null)
330                 throw new ArgumentException(
331                     String.Format(
332                         CultureInfo.CurrentCulture,
333                         Environment.GetResourceString("Argument_InvalidCultureName"), m_name), "m_name");
334
335             if (m_cultureId == 0)
336             {
337                 SetName(this.m_name);
338             }
339             else
340             {
341                 this.m_name = this.m_cultureData.SREGIONNAME;
342             }
343         }
344
345         [OnSerializing] 
346         private void OnSerializing(StreamingContext ctx) 
347         { 
348             // Used to fill in everett data item, unnecessary now
349         }   
350 #endregion Serialization
351
352         ////////////////////////////////////////////////////////////////////////
353         //
354         //  GetCurrentRegion
355         //
356         //  This instance provides methods based on the current user settings.
357         //  These settings are volatile and may change over the lifetime of the
358         //  thread.
359         //
360         ////////////////////////////////////////////////////////////////////////
361         public static RegionInfo CurrentRegion {
362             [System.Security.SecuritySafeCritical]  // auto-generated
363             get {
364                 RegionInfo temp = s_currentRegionInfo;
365                 if (temp == null)
366                 {
367                     temp = new RegionInfo(CultureInfo.CurrentCulture.m_cultureData);
368
369                     // Need full name for custom cultures
370                     temp.m_name=temp.m_cultureData.SREGIONNAME;
371                     s_currentRegionInfo = temp;
372                 }
373                 return temp;
374             }
375         }
376
377         ////////////////////////////////////////////////////////////////////////
378         //
379         //  GetName
380         //
381         //  Returns the name of the region (ie: en-US)
382         //
383         ////////////////////////////////////////////////////////////////////////
384         public virtual String Name {
385             get {
386                 Contract.Assert(m_name != null, "Expected RegionInfo.m_name to be populated already");
387                 return (m_name);
388             }
389         }
390
391         ////////////////////////////////////////////////////////////////////////
392         //
393         //  GetEnglishName
394         //
395         //  Returns the name of the region in English. (ie: United States)
396         //
397         ////////////////////////////////////////////////////////////////////////
398         public virtual String EnglishName
399         {
400             [System.Security.SecuritySafeCritical]  // auto-generated
401             get
402             {
403                 return (this.m_cultureData.SENGCOUNTRY);
404             }
405         }
406
407
408         ////////////////////////////////////////////////////////////////////////
409         //
410         //  GetDisplayName
411         //
412         //  Returns the display name (localized) of the region. (ie: United States
413         //  if the current UI language is en-US)
414         //
415         ////////////////////////////////////////////////////////////////////////
416         public virtual String DisplayName 
417         {
418             [System.Security.SecuritySafeCritical]  // auto-generated
419             get 
420             {
421                 return (this.m_cultureData.SLOCALIZEDCOUNTRY);
422             }
423         }
424
425
426         ////////////////////////////////////////////////////////////////////////
427         //
428         //  GetNativeName
429         //
430         //  Returns the native name of the region. (ie: Deutschland)
431         //  WARNING: You need a full locale name for this to make sense.        
432         //
433         ////////////////////////////////////////////////////////////////////////
434         [System.Runtime.InteropServices.ComVisible(false)]
435         public virtual String NativeName
436         {
437             [System.Security.SecuritySafeCritical]  // auto-generated
438             get
439             {
440                 return (this.m_cultureData.SNATIVECOUNTRY);
441             }
442         }
443
444         ////////////////////////////////////////////////////////////////////////
445         //
446         //  TwoLetterISORegionName
447         //
448         //  Returns the two letter ISO region name (ie: US)
449         //
450         ////////////////////////////////////////////////////////////////////////
451         public virtual String TwoLetterISORegionName
452         {
453             [System.Security.SecuritySafeCritical]  // auto-generated
454             get
455             {
456                 return (this.m_cultureData.SISO3166CTRYNAME);
457             }
458         }
459
460
461         ////////////////////////////////////////////////////////////////////////
462         //
463         //  ThreeLetterISORegionName
464         //
465         //  Returns the three letter ISO region name (ie: USA)
466         //
467         ////////////////////////////////////////////////////////////////////////
468         public virtual String ThreeLetterISORegionName
469         {
470             [System.Security.SecuritySafeCritical]  // auto-generated
471             get
472             {
473                 return (this.m_cultureData.SISO3166CTRYNAME2);
474             }
475         }
476
477         ////////////////////////////////////////////////////////////////////////
478         //
479         //  ThreeLetterWindowsRegionName
480         //
481         //  Returns the three letter windows region name (ie: USA)
482         //
483         ////////////////////////////////////////////////////////////////////////
484         public virtual String ThreeLetterWindowsRegionName
485         {
486             [System.Security.SecuritySafeCritical]  // auto-generated
487             get
488             {
489                 return (this.m_cultureData.SABBREVCTRYNAME);
490             }
491         }
492
493         ////////////////////////////////////////////////////////////////////////
494         //
495         //  IsMetric
496         //
497         //  Returns true if this region uses the metric measurement system
498         //
499         ////////////////////////////////////////////////////////////////////////
500         public virtual bool IsMetric {
501             get {
502                 int value = this.m_cultureData.IMEASURE;
503                 return (value==0);
504             }
505         }
506
507
508         [System.Runtime.InteropServices.ComVisible(false)]        
509         public virtual int GeoId 
510         {
511             get 
512             {
513                 return (this.m_cultureData.IGEOID);
514             }
515         }
516
517         ////////////////////////////////////////////////////////////////////////
518         //
519         //  CurrencyEnglishName
520         //
521         //  English name for this region's currency, ie: Swiss Franc
522         //
523         ////////////////////////////////////////////////////////////////////////
524         [System.Runtime.InteropServices.ComVisible(false)]
525         public virtual String CurrencyEnglishName
526         {
527             [System.Security.SecuritySafeCritical]  // auto-generated
528             get
529             {
530                 return (this.m_cultureData.SENGLISHCURRENCY);
531             }
532         }
533
534         ////////////////////////////////////////////////////////////////////////
535         //
536         //  CurrencyEnglishName
537         //
538         //  English name for this region's currency, ie: Schweizer Franken
539         //  WARNING: You need a full locale name for this to make sense.
540         //
541         ////////////////////////////////////////////////////////////////////////
542         [System.Runtime.InteropServices.ComVisible(false)]
543         public virtual String CurrencyNativeName
544         {
545             [System.Security.SecuritySafeCritical]  // auto-generated
546             get
547             {
548                 return (this.m_cultureData.SNATIVECURRENCY);
549             }
550         }
551
552         ////////////////////////////////////////////////////////////////////////
553         //
554         //  CurrencySymbol
555         //
556         //  Currency Symbol for this locale, ie: Fr. or $
557         //
558         ////////////////////////////////////////////////////////////////////////
559         public virtual String CurrencySymbol {
560             [System.Security.SecuritySafeCritical]  // auto-generated
561             get {
562                 return (this.m_cultureData.SCURRENCY);
563             }
564         }
565
566         ////////////////////////////////////////////////////////////////////////
567         //
568         //  ISOCurrencySymbol
569         //
570         //  ISO Currency Symbol for this locale, ie: CHF
571         //
572         ////////////////////////////////////////////////////////////////////////
573         public virtual String ISOCurrencySymbol {
574             [System.Security.SecuritySafeCritical]  // auto-generated
575             get {
576                 return (this.m_cultureData.SINTLSYMBOL);
577             }
578         }
579
580         ////////////////////////////////////////////////////////////////////////
581         //
582         //  Equals
583         //
584         //  Implements Object.Equals().  Returns a boolean indicating whether
585         //  or not object refers to the same RegionInfo as the current instance.
586         //
587         //  RegionInfos are considered equal if and only if they have the same name
588         //  (ie: en-US)
589         //
590         ////////////////////////////////////////////////////////////////////////
591         public override bool Equals(Object value)
592         {
593             RegionInfo that = value as RegionInfo;
594             if (that != null)
595             {
596                 return this.Name.Equals(that.Name);
597             }
598
599             return (false);
600         }
601
602         ////////////////////////////////////////////////////////////////////////
603         //
604         //  GetHashCode
605         //
606         //  Implements Object.GetHashCode().  Returns the hash code for the
607         //  CultureInfo.  The hash code is guaranteed to be the same for RegionInfo
608         //  A and B where A.Equals(B) is true.
609         //
610         ////////////////////////////////////////////////////////////////////////
611         public override int GetHashCode()
612         {
613             return (this.Name.GetHashCode());
614         }
615
616
617         ////////////////////////////////////////////////////////////////////////
618         //
619         //  ToString
620         //
621         //  Implements Object.ToString().  Returns the name of the Region, ie: es-US
622         //
623         ////////////////////////////////////////////////////////////////////////
624         public override String ToString()
625         {
626             return (Name);
627         }    
628     }
629 }