mscorlib(4.0.0.0) API with additions
CultureInfo.cs
1 using System.Collections;
2 using System.Resources;
6 using System.Security;
8 using System.Threading;
9 
10 namespace System.Globalization
11 {
13  [Serializable]
14  [ComVisible(true)]
15  [__DynamicallyInvokable]
17  {
18  internal bool m_isReadOnly;
19 
20  internal CompareInfo compareInfo;
21 
22  internal TextInfo textInfo;
23 
24  [NonSerialized]
25  internal RegionInfo regionInfo;
26 
27  internal NumberFormatInfo numInfo;
28 
29  internal DateTimeFormatInfo dateTimeInfo;
30 
31  internal Calendar calendar;
32 
33  [OptionalField(VersionAdded = 1)]
34  internal int m_dataItem;
35 
36  [OptionalField(VersionAdded = 1)]
37  internal int cultureID = 127;
38 
39  [NonSerialized]
40  internal CultureData m_cultureData;
41 
42  [NonSerialized]
43  internal bool m_isInherited;
44 
45  [NonSerialized]
46  private bool m_isSafeCrossDomain;
47 
48  [NonSerialized]
49  private int m_createdDomainID;
50 
51  [NonSerialized]
52  private CultureInfo m_consoleFallbackCulture;
53 
54  internal string m_name;
55 
56  [NonSerialized]
57  private string m_nonSortName;
58 
59  [NonSerialized]
60  private string m_sortName;
61 
62  private static volatile CultureInfo s_userDefaultCulture;
63 
64  private static volatile CultureInfo s_InvariantCultureInfo;
65 
66  private static volatile CultureInfo s_userDefaultUICulture;
67 
68  private static volatile CultureInfo s_InstalledUICultureInfo;
69 
70  private static volatile CultureInfo s_DefaultThreadCurrentUICulture;
71 
72  private static volatile CultureInfo s_DefaultThreadCurrentCulture;
73 
74  private static volatile Hashtable s_LcidCachedCultures;
75 
76  private static volatile Hashtable s_NameCachedCultures;
77 
78  [SecurityCritical]
79  private static volatile WindowsRuntimeResourceManagerBase s_WindowsRuntimeResourceManager;
80 
81  [ThreadStatic]
82  private static bool ts_IsDoingAppXCultureInfoLookup;
83 
84  [NonSerialized]
85  private CultureInfo m_parent;
86 
87  internal const int LOCALE_NEUTRAL = 0;
88 
89  private const int LOCALE_USER_DEFAULT = 1024;
90 
91  private const int LOCALE_SYSTEM_DEFAULT = 2048;
92 
93  internal const int LOCALE_CUSTOM_DEFAULT = 3072;
94 
95  internal const int LOCALE_CUSTOM_UNSPECIFIED = 4096;
96 
97  internal const int LOCALE_INVARIANT = 127;
98 
99  private const int LOCALE_TRADITIONAL_SPANISH = 1034;
100 
101  private static readonly bool init = Init();
102 
103  private bool m_useUserOverride;
104 
105  private const int LOCALE_SORTID_MASK = 983040;
106 
107  private static volatile bool s_isTaiwanSku;
108 
109  private static volatile bool s_haveIsTaiwanSku;
110 
111  internal bool IsSafeCrossDomain => m_isSafeCrossDomain;
112 
113  internal int CreatedDomainID => m_createdDomainID;
114 
118  [__DynamicallyInvokable]
119  public static CultureInfo CurrentCulture
120  {
121  [__DynamicallyInvokable]
122  get
123  {
125  }
126  [__DynamicallyInvokable]
127  set
128  {
129  if (value == null)
130  {
131  throw new ArgumentNullException("value");
132  }
133  if (!AppDomain.IsAppXModel() || !SetCultureInfoForUserPreferredLanguageInAppX(value))
134  {
136  }
137  }
138  }
139 
140  internal static CultureInfo UserDefaultCulture
141  {
142  get
143  {
144  CultureInfo cultureInfo = s_userDefaultCulture;
145  if (cultureInfo == null)
146  {
147  s_userDefaultCulture = InvariantCulture;
148  cultureInfo = (s_userDefaultCulture = InitUserDefaultCulture());
149  }
150  return cultureInfo;
151  }
152  }
153 
154  internal static CultureInfo UserDefaultUICulture
155  {
156  get
157  {
158  CultureInfo cultureInfo = s_userDefaultUICulture;
159  if (cultureInfo == null)
160  {
161  s_userDefaultUICulture = InvariantCulture;
162  cultureInfo = (s_userDefaultUICulture = InitUserDefaultUICulture());
163  }
164  return cultureInfo;
165  }
166  }
167 
172  [__DynamicallyInvokable]
173  public static CultureInfo CurrentUICulture
174  {
175  [__DynamicallyInvokable]
176  get
177  {
179  }
180  [__DynamicallyInvokable]
181  set
182  {
183  if (value == null)
184  {
185  throw new ArgumentNullException("value");
186  }
187  if (!AppDomain.IsAppXModel() || !SetCultureInfoForUserPreferredLanguageInAppX(value))
188  {
190  }
191  }
192  }
193 
196  public static CultureInfo InstalledUICulture
197  {
198  get
199  {
200  CultureInfo cultureInfo = s_InstalledUICultureInfo;
201  if (cultureInfo == null)
202  {
203  string systemDefaultUILanguage = GetSystemDefaultUILanguage();
204  cultureInfo = GetCultureByName(systemDefaultUILanguage, userOverride: true);
205  if (cultureInfo == null)
206  {
207  cultureInfo = InvariantCulture;
208  }
209  cultureInfo.m_isReadOnly = true;
210  s_InstalledUICultureInfo = cultureInfo;
211  }
212  return cultureInfo;
213  }
214  }
215 
218  [__DynamicallyInvokable]
220  {
221  [__DynamicallyInvokable]
222  get
223  {
224  return s_DefaultThreadCurrentCulture;
225  }
226  [SecuritySafeCritical]
227  [__DynamicallyInvokable]
229  set
230  {
231  s_DefaultThreadCurrentCulture = value;
232  }
233  }
234 
238  [__DynamicallyInvokable]
240  {
241  [__DynamicallyInvokable]
242  get
243  {
244  return s_DefaultThreadCurrentUICulture;
245  }
246  [SecuritySafeCritical]
247  [__DynamicallyInvokable]
249  set
250  {
251  if (value != null)
252  {
253  VerifyCultureName(value, throwException: true);
254  }
255  s_DefaultThreadCurrentUICulture = value;
256  }
257  }
258 
261  [__DynamicallyInvokable]
262  public static CultureInfo InvariantCulture
263  {
264  [__DynamicallyInvokable]
265  get
266  {
267  return s_InvariantCultureInfo;
268  }
269  }
270 
273  [__DynamicallyInvokable]
274  public virtual CultureInfo Parent
275  {
276  [SecuritySafeCritical]
277  [__DynamicallyInvokable]
278  get
279  {
280  CultureInfo cultureInfo = null;
281  if (m_parent == null)
282  {
283  string sPARENT = m_cultureData.SPARENT;
284  if (string.IsNullOrEmpty(sPARENT))
285  {
286  cultureInfo = InvariantCulture;
287  }
288  else
289  {
290  cultureInfo = CreateCultureInfoNoThrow(sPARENT, m_cultureData.UseUserOverride);
291  if (cultureInfo == null)
292  {
293  cultureInfo = InvariantCulture;
294  }
295  }
296  Interlocked.CompareExchange(ref m_parent, cultureInfo, null);
297  }
298  return m_parent;
299  }
300  }
301 
304  public virtual int LCID => m_cultureData.ILANGUAGE;
305 
308  [ComVisible(false)]
309  public virtual int KeyboardLayoutId
310  {
311  get
312  {
313  return m_cultureData.IINPUTLANGUAGEHANDLE;
314  }
315  }
316 
319  [__DynamicallyInvokable]
320  public virtual string Name
321  {
322  [__DynamicallyInvokable]
323  get
324  {
325  if (m_nonSortName == null)
326  {
327  m_nonSortName = m_cultureData.SNAME;
328  if (m_nonSortName == null)
329  {
330  m_nonSortName = string.Empty;
331  }
332  }
333  return m_nonSortName;
334  }
335  }
336 
337  internal string SortName
338  {
339  get
340  {
341  if (m_sortName == null)
342  {
343  m_sortName = m_cultureData.SCOMPAREINFO;
344  }
345  return m_sortName;
346  }
347  }
348 
351  [ComVisible(false)]
352  public string IetfLanguageTag
353  {
354  get
355  {
356  string name = Name;
357  if (!(name == "zh-CHT"))
358  {
359  if (name == "zh-CHS")
360  {
361  return "zh-Hans";
362  }
363  return Name;
364  }
365  return "zh-Hant";
366  }
367  }
368 
371  [__DynamicallyInvokable]
372  public virtual string DisplayName
373  {
374  [SecuritySafeCritical]
375  [__DynamicallyInvokable]
376  get
377  {
378  return m_cultureData.SLOCALIZEDDISPLAYNAME;
379  }
380  }
381 
384  [__DynamicallyInvokable]
385  public virtual string NativeName
386  {
387  [SecuritySafeCritical]
388  [__DynamicallyInvokable]
389  get
390  {
391  return m_cultureData.SNATIVEDISPLAYNAME;
392  }
393  }
394 
397  [__DynamicallyInvokable]
398  public virtual string EnglishName
399  {
400  [SecuritySafeCritical]
401  [__DynamicallyInvokable]
402  get
403  {
404  return m_cultureData.SENGDISPLAYNAME;
405  }
406  }
407 
410  [__DynamicallyInvokable]
411  public virtual string TwoLetterISOLanguageName
412  {
413  [SecuritySafeCritical]
414  [__DynamicallyInvokable]
415  get
416  {
417  return m_cultureData.SISO639LANGNAME;
418  }
419  }
420 
423  public virtual string ThreeLetterISOLanguageName
424  {
425  [SecuritySafeCritical]
426  get
427  {
428  return m_cultureData.SISO639LANGNAME2;
429  }
430  }
431 
434  public virtual string ThreeLetterWindowsLanguageName
435  {
436  [SecuritySafeCritical]
437  get
438  {
439  return m_cultureData.SABBREVLANGNAME;
440  }
441  }
442 
445  [__DynamicallyInvokable]
446  public virtual CompareInfo CompareInfo
447  {
448  [__DynamicallyInvokable]
449  get
450  {
451  if (compareInfo == null)
452  {
453  CompareInfo result = UseUserOverride ? GetCultureInfo(m_name).CompareInfo : new CompareInfo(this);
454  if (!CompatibilitySwitches.IsCompatibilityBehaviorDefined)
455  {
456  return result;
457  }
458  compareInfo = result;
459  }
460  return compareInfo;
461  }
462  }
463 
464  private RegionInfo Region
465  {
466  get
467  {
468  if (this.regionInfo == null)
469  {
470  RegionInfo regionInfo = this.regionInfo = new RegionInfo(m_cultureData);
471  }
472  return this.regionInfo;
473  }
474  }
475 
478  [__DynamicallyInvokable]
479  public virtual TextInfo TextInfo
480  {
481  [__DynamicallyInvokable]
482  get
483  {
484  if (this.textInfo == null)
485  {
486  TextInfo textInfo = new TextInfo(m_cultureData);
487  textInfo.SetReadOnlyState(m_isReadOnly);
488  if (!CompatibilitySwitches.IsCompatibilityBehaviorDefined)
489  {
490  return textInfo;
491  }
492  this.textInfo = textInfo;
493  }
494  return this.textInfo;
495  }
496  }
497 
501  [__DynamicallyInvokable]
502  public virtual bool IsNeutralCulture
503  {
504  [__DynamicallyInvokable]
505  get
506  {
507  return m_cultureData.IsNeutralCulture;
508  }
509  }
510 
513  [ComVisible(false)]
515  {
516  get
517  {
518  CultureTypes cultureTypes = (CultureTypes)0;
519  cultureTypes = ((!m_cultureData.IsNeutralCulture) ? (cultureTypes | CultureTypes.SpecificCultures) : (cultureTypes | CultureTypes.NeutralCultures));
520  cultureTypes = (CultureTypes)((int)cultureTypes | (m_cultureData.IsWin32Installed ? 4 : 0));
521  cultureTypes = (CultureTypes)((int)cultureTypes | (m_cultureData.IsFramework ? 64 : 0));
522  cultureTypes = (CultureTypes)((int)cultureTypes | (m_cultureData.IsSupplementalCustomCulture ? 8 : 0));
523  return (CultureTypes)((int)cultureTypes | (m_cultureData.IsReplacementCulture ? 24 : 0));
524  }
525  }
526 
531  [__DynamicallyInvokable]
532  public virtual NumberFormatInfo NumberFormat
533  {
534  [__DynamicallyInvokable]
535  get
536  {
537  if (numInfo == null)
538  {
539  NumberFormatInfo numberFormatInfo = new NumberFormatInfo(m_cultureData);
540  numberFormatInfo.isReadOnly = m_isReadOnly;
541  numInfo = numberFormatInfo;
542  }
543  return numInfo;
544  }
545  [__DynamicallyInvokable]
546  set
547  {
548  if (value == null)
549  {
550  throw new ArgumentNullException("value", Environment.GetResourceString("ArgumentNull_Obj"));
551  }
552  VerifyWritable();
553  numInfo = value;
554  }
555  }
556 
561  [__DynamicallyInvokable]
562  public virtual DateTimeFormatInfo DateTimeFormat
563  {
564  [__DynamicallyInvokable]
565  get
566  {
567  if (dateTimeInfo == null)
568  {
569  DateTimeFormatInfo dateTimeFormatInfo = new DateTimeFormatInfo(m_cultureData, Calendar);
570  dateTimeFormatInfo.m_isReadOnly = m_isReadOnly;
572  dateTimeInfo = dateTimeFormatInfo;
573  }
574  return dateTimeInfo;
575  }
576  [__DynamicallyInvokable]
577  set
578  {
579  if (value == null)
580  {
581  throw new ArgumentNullException("value", Environment.GetResourceString("ArgumentNull_Obj"));
582  }
583  VerifyWritable();
584  dateTimeInfo = value;
585  }
586  }
587 
590  [__DynamicallyInvokable]
591  public virtual Calendar Calendar
592  {
593  [__DynamicallyInvokable]
594  get
595  {
596  if (calendar == null)
597  {
598  Calendar defaultCalendar = m_cultureData.DefaultCalendar;
600  defaultCalendar.SetReadOnlyState(m_isReadOnly);
601  calendar = defaultCalendar;
602  }
603  return calendar;
604  }
605  }
606 
609  [__DynamicallyInvokable]
610  public virtual Calendar[] OptionalCalendars
611  {
612  [__DynamicallyInvokable]
613  get
614  {
615  int[] calendarIds = m_cultureData.CalendarIds;
616  Calendar[] array = new Calendar[calendarIds.Length];
617  for (int i = 0; i < array.Length; i++)
618  {
619  array[i] = GetCalendarInstance(calendarIds[i]);
620  }
621  return array;
622  }
623  }
624 
628  public bool UseUserOverride => m_cultureData.UseUserOverride;
629 
633  [__DynamicallyInvokable]
634  public bool IsReadOnly
635  {
636  [__DynamicallyInvokable]
637  get
638  {
639  return m_isReadOnly;
640  }
641  }
642 
643  internal bool HasInvariantCultureName => Name == InvariantCulture.Name;
644 
645  internal static bool IsTaiwanSku
646  {
647  get
648  {
649  if (!s_haveIsTaiwanSku)
650  {
651  s_isTaiwanSku = (GetSystemDefaultUILanguage() == "zh-TW");
652  s_haveIsTaiwanSku = true;
653  }
654  return s_isTaiwanSku;
655  }
656  }
657 
658  private static bool Init()
659  {
660  if (s_InvariantCultureInfo == null)
661  {
662  CultureInfo cultureInfo = new CultureInfo("", useUserOverride: false);
663  cultureInfo.m_isReadOnly = true;
664  s_InvariantCultureInfo = cultureInfo;
665  }
666  s_userDefaultCulture = (s_userDefaultUICulture = s_InvariantCultureInfo);
667  s_userDefaultCulture = InitUserDefaultCulture();
668  s_userDefaultUICulture = InitUserDefaultUICulture();
669  return true;
670  }
671 
672  [SecuritySafeCritical]
673  private static CultureInfo InitUserDefaultCulture()
674  {
675  string defaultLocaleName = GetDefaultLocaleName(1024);
676  if (defaultLocaleName == null)
677  {
678  defaultLocaleName = GetDefaultLocaleName(2048);
679  if (defaultLocaleName == null)
680  {
681  return InvariantCulture;
682  }
683  }
684  CultureInfo cultureByName = GetCultureByName(defaultLocaleName, userOverride: true);
685  cultureByName.m_isReadOnly = true;
686  return cultureByName;
687  }
688 
689  private static CultureInfo InitUserDefaultUICulture()
690  {
691  string userDefaultUILanguage = GetUserDefaultUILanguage();
692  if (userDefaultUILanguage == UserDefaultCulture.Name)
693  {
694  return UserDefaultCulture;
695  }
696  CultureInfo cultureByName = GetCultureByName(userDefaultUILanguage, userOverride: true);
697  if (cultureByName == null)
698  {
699  return InvariantCulture;
700  }
701  cultureByName.m_isReadOnly = true;
702  return cultureByName;
703  }
704 
705  [SecuritySafeCritical]
706  internal static CultureInfo GetCultureInfoForUserPreferredLanguageInAppX()
707  {
708  if (ts_IsDoingAppXCultureInfoLookup)
709  {
710  return null;
711  }
712  if (AppDomain.IsAppXNGen)
713  {
714  return null;
715  }
716  CultureInfo cultureInfo = null;
717  try
718  {
719  ts_IsDoingAppXCultureInfoLookup = true;
720  if (s_WindowsRuntimeResourceManager == null)
721  {
722  s_WindowsRuntimeResourceManager = ResourceManager.GetWinRTResourceManager();
723  }
724  return s_WindowsRuntimeResourceManager.GlobalResourceContextBestFitCultureInfo;
725  }
726  finally
727  {
728  ts_IsDoingAppXCultureInfoLookup = false;
729  }
730  }
731 
732  [SecuritySafeCritical]
733  internal static bool SetCultureInfoForUserPreferredLanguageInAppX(CultureInfo ci)
734  {
735  if (AppDomain.IsAppXNGen)
736  {
737  return false;
738  }
739  if (s_WindowsRuntimeResourceManager == null)
740  {
741  s_WindowsRuntimeResourceManager = ResourceManager.GetWinRTResourceManager();
742  }
743  return s_WindowsRuntimeResourceManager.SetGlobalResourceContextDefaultCulture(ci);
744  }
745 
752  [__DynamicallyInvokable]
753  public CultureInfo(string name)
754  : this(name, useUserOverride: true)
755  {
756  }
757 
765  public CultureInfo(string name, bool useUserOverride)
766  {
767  if (name == null)
768  {
769  throw new ArgumentNullException("name", Environment.GetResourceString("ArgumentNull_String"));
770  }
771  m_cultureData = CultureData.GetCultureData(name, useUserOverride);
772  if (m_cultureData == null)
773  {
774  throw new CultureNotFoundException("name", name, Environment.GetResourceString("Argument_CultureNotSupported"));
775  }
776  m_name = m_cultureData.CultureName;
777  m_isInherited = (GetType() != typeof(CultureInfo));
778  }
779 
780  private CultureInfo(CultureData cultureData)
781  {
782  m_cultureData = cultureData;
783  m_name = cultureData.CultureName;
784  m_isInherited = false;
785  }
786 
787  private static CultureInfo CreateCultureInfoNoThrow(string name, bool useUserOverride)
788  {
789  CultureData cultureData = CultureData.GetCultureData(name, useUserOverride);
790  if (cultureData == null)
791  {
792  return null;
793  }
794  return new CultureInfo(cultureData);
795  }
796 
803  public CultureInfo(int culture)
804  : this(culture, useUserOverride: true)
805  {
806  }
807 
815  public CultureInfo(int culture, bool useUserOverride)
816  {
817  if (culture < 0)
818  {
819  throw new ArgumentOutOfRangeException("culture", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
820  }
821  InitializeFromCultureId(culture, useUserOverride);
822  }
823 
824  private void InitializeFromCultureId(int culture, bool useUserOverride)
825  {
826  switch (culture)
827  {
828  case 0:
829  case 1024:
830  case 2048:
831  case 3072:
832  case 4096:
833  throw new CultureNotFoundException("culture", culture, Environment.GetResourceString("Argument_CultureNotSupported"));
834  }
835  m_cultureData = CultureData.GetCultureData(culture, useUserOverride);
836  m_isInherited = (GetType() != typeof(CultureInfo));
837  m_name = m_cultureData.CultureName;
838  }
839 
840  internal static void CheckDomainSafetyObject(object obj, object container)
841  {
842  if (obj.GetType().Assembly != typeof(CultureInfo).Assembly)
843  {
844  throw new InvalidOperationException(string.Format(CurrentCulture, Environment.GetResourceString("InvalidOperation_SubclassedObject"), obj.GetType(), container.GetType()));
845  }
846  }
847 
848  [OnDeserialized]
849  private void OnDeserialized(StreamingContext ctx)
850  {
851  if (m_name == null || IsAlternateSortLcid(cultureID))
852  {
853  InitializeFromCultureId(cultureID, m_useUserOverride);
854  }
855  else
856  {
857  m_cultureData = CultureData.GetCultureData(m_name, m_useUserOverride);
858  if (m_cultureData == null)
859  {
860  throw new CultureNotFoundException("m_name", m_name, Environment.GetResourceString("Argument_CultureNotSupported"));
861  }
862  }
863  m_isInherited = (GetType() != typeof(CultureInfo));
864  if (GetType().Assembly == typeof(CultureInfo).Assembly)
865  {
866  if (textInfo != null)
867  {
868  CheckDomainSafetyObject(textInfo, this);
869  }
870  if (compareInfo != null)
871  {
872  CheckDomainSafetyObject(compareInfo, this);
873  }
874  }
875  }
876 
877  private static bool IsAlternateSortLcid(int lcid)
878  {
879  if (lcid == 1034)
880  {
881  return true;
882  }
883  return (lcid & 0xF0000) != 0;
884  }
885 
886  [OnSerializing]
887  private void OnSerializing(StreamingContext ctx)
888  {
889  m_name = m_cultureData.CultureName;
890  m_useUserOverride = m_cultureData.UseUserOverride;
891  cultureID = m_cultureData.ILANGUAGE;
892  }
893 
894  internal void StartCrossDomainTracking()
895  {
896  if (m_createdDomainID == 0)
897  {
898  if (CanSendCrossDomain())
899  {
900  m_isSafeCrossDomain = true;
901  }
903  m_createdDomainID = Thread.GetDomainID();
904  }
905  }
906 
907  internal bool CanSendCrossDomain()
908  {
909  bool result = false;
910  if (GetType() == typeof(CultureInfo))
911  {
912  result = true;
913  }
914  return result;
915  }
916 
917  internal CultureInfo(string cultureName, string textAndCompareCultureName)
918  {
919  if (cultureName == null)
920  {
921  throw new ArgumentNullException("cultureName", Environment.GetResourceString("ArgumentNull_String"));
922  }
923  m_cultureData = CultureData.GetCultureData(cultureName, useUserOverride: false);
924  if (m_cultureData == null)
925  {
926  throw new CultureNotFoundException("cultureName", cultureName, Environment.GetResourceString("Argument_CultureNotSupported"));
927  }
928  m_name = m_cultureData.CultureName;
929  CultureInfo cultureInfo = GetCultureInfo(textAndCompareCultureName);
930  compareInfo = cultureInfo.CompareInfo;
931  textInfo = cultureInfo.TextInfo;
932  }
933 
934  private static CultureInfo GetCultureByName(string name, bool userOverride)
935  {
936  try
937  {
938  return userOverride ? new CultureInfo(name) : GetCultureInfo(name);
939  }
940  catch (ArgumentException)
941  {
942  }
943  return null;
944  }
945 
953  public static CultureInfo CreateSpecificCulture(string name)
954  {
955  CultureInfo cultureInfo;
956  try
957  {
958  cultureInfo = new CultureInfo(name);
959  }
960  catch (ArgumentException)
961  {
962  cultureInfo = null;
963  for (int i = 0; i < name.Length; i++)
964  {
965  if ('-' == name[i])
966  {
967  try
968  {
969  cultureInfo = new CultureInfo(name.Substring(0, i));
970  }
971  catch (ArgumentException)
972  {
973  throw;
974  }
975  break;
976  }
977  }
978  if (cultureInfo == null)
979  {
980  throw;
981  }
982  }
983  if (!cultureInfo.IsNeutralCulture)
984  {
985  return cultureInfo;
986  }
987  return new CultureInfo(cultureInfo.m_cultureData.SSPECIFICCULTURE);
988  }
989 
990  internal static bool VerifyCultureName(string cultureName, bool throwException)
991  {
992  foreach (char c in cultureName)
993  {
994  if (!char.IsLetterOrDigit(c) && c != '-' && c != '_')
995  {
996  if (throwException)
997  {
998  throw new ArgumentException(Environment.GetResourceString("Argument_InvalidResourceCultureName", cultureName));
999  }
1000  return false;
1001  }
1002  }
1003  return true;
1004  }
1005 
1006  internal static bool VerifyCultureName(CultureInfo culture, bool throwException)
1007  {
1008  if (!culture.m_isInherited)
1009  {
1010  return true;
1011  }
1012  return VerifyCultureName(culture.Name, throwException);
1013  }
1014 
1020  public static CultureInfo[] GetCultures(CultureTypes types)
1021  {
1022  if ((types & CultureTypes.UserCustomCulture) == CultureTypes.UserCustomCulture)
1023  {
1024  types |= CultureTypes.ReplacementCultures;
1025  }
1026  return CultureData.GetCultures(types);
1027  }
1028 
1033  [__DynamicallyInvokable]
1034  public override bool Equals(object value)
1035  {
1036  if (this == value)
1037  {
1038  return true;
1039  }
1040  CultureInfo cultureInfo = value as CultureInfo;
1041  if (cultureInfo != null)
1042  {
1043  if (Name.Equals(cultureInfo.Name))
1044  {
1045  return CompareInfo.Equals(cultureInfo.CompareInfo);
1046  }
1047  return false;
1048  }
1049  return false;
1050  }
1051 
1054  [__DynamicallyInvokable]
1055  public override int GetHashCode()
1056  {
1057  return Name.GetHashCode() + CompareInfo.GetHashCode();
1058  }
1059 
1062  [__DynamicallyInvokable]
1063  public override string ToString()
1064  {
1065  return m_name;
1066  }
1067 
1071  [__DynamicallyInvokable]
1072  public virtual object GetFormat(Type formatType)
1073  {
1074  if (formatType == typeof(NumberFormatInfo))
1075  {
1076  return NumberFormat;
1077  }
1078  if (formatType == typeof(DateTimeFormatInfo))
1079  {
1080  return DateTimeFormat;
1081  }
1082  return null;
1083  }
1084 
1086  public void ClearCachedData()
1087  {
1088  s_userDefaultUICulture = null;
1089  s_userDefaultCulture = null;
1090  RegionInfo.s_currentRegionInfo = null;
1091  TimeZone.ResetTimeZone();
1093  s_LcidCachedCultures = null;
1094  s_NameCachedCultures = null;
1095  CultureData.ClearCachedData();
1096  }
1097 
1098  internal static Calendar GetCalendarInstance(int calType)
1099  {
1100  if (calType == 1)
1101  {
1102  return new GregorianCalendar();
1103  }
1104  return GetCalendarInstanceRare(calType);
1105  }
1106 
1107  internal static Calendar GetCalendarInstanceRare(int calType)
1108  {
1109  switch (calType)
1110  {
1111  case 2:
1112  case 9:
1113  case 10:
1114  case 11:
1115  case 12:
1116  return new GregorianCalendar((GregorianCalendarTypes)calType);
1117  case 4:
1118  return new TaiwanCalendar();
1119  case 3:
1120  return new JapaneseCalendar();
1121  case 5:
1122  return new KoreanCalendar();
1123  case 7:
1124  return new ThaiBuddhistCalendar();
1125  case 6:
1126  return new HijriCalendar();
1127  case 8:
1128  return new HebrewCalendar();
1129  case 23:
1130  return new UmAlQuraCalendar();
1131  case 22:
1132  return new PersianCalendar();
1133  case 15:
1134  return new ChineseLunisolarCalendar();
1135  case 14:
1136  return new JapaneseLunisolarCalendar();
1137  case 20:
1138  return new KoreanLunisolarCalendar();
1139  case 21:
1140  return new TaiwanLunisolarCalendar();
1141  default:
1142  return new GregorianCalendar();
1143  }
1144  }
1145 
1148  [SecuritySafeCritical]
1149  [ComVisible(false)]
1151  {
1152  CultureInfo cultureInfo = m_consoleFallbackCulture;
1153  if (cultureInfo == null)
1154  {
1155  cultureInfo = CreateSpecificCulture(m_cultureData.SCONSOLEFALLBACKNAME);
1156  cultureInfo.m_isReadOnly = true;
1157  m_consoleFallbackCulture = cultureInfo;
1158  }
1159  return cultureInfo;
1160  }
1161 
1164  [__DynamicallyInvokable]
1165  public virtual object Clone()
1166  {
1167  CultureInfo cultureInfo = (CultureInfo)MemberwiseClone();
1168  cultureInfo.m_isReadOnly = false;
1169  if (!m_isInherited)
1170  {
1171  if (dateTimeInfo != null)
1172  {
1173  cultureInfo.dateTimeInfo = (DateTimeFormatInfo)dateTimeInfo.Clone();
1174  }
1175  if (numInfo != null)
1176  {
1177  cultureInfo.numInfo = (NumberFormatInfo)numInfo.Clone();
1178  }
1179  }
1180  else
1181  {
1184  }
1185  if (textInfo != null)
1186  {
1187  cultureInfo.textInfo = (TextInfo)textInfo.Clone();
1188  }
1189  if (calendar != null)
1190  {
1191  cultureInfo.calendar = (Calendar)calendar.Clone();
1192  }
1193  return cultureInfo;
1194  }
1195 
1201  [__DynamicallyInvokable]
1203  {
1204  if (ci == null)
1205  {
1206  throw new ArgumentNullException("ci");
1207  }
1208  if (ci.IsReadOnly)
1209  {
1210  return ci;
1211  }
1212  CultureInfo cultureInfo = (CultureInfo)ci.MemberwiseClone();
1213  if (!ci.IsNeutralCulture)
1214  {
1215  if (!ci.m_isInherited)
1216  {
1217  if (ci.dateTimeInfo != null)
1218  {
1219  cultureInfo.dateTimeInfo = DateTimeFormatInfo.ReadOnly(ci.dateTimeInfo);
1220  }
1221  if (ci.numInfo != null)
1222  {
1223  cultureInfo.numInfo = NumberFormatInfo.ReadOnly(ci.numInfo);
1224  }
1225  }
1226  else
1227  {
1228  cultureInfo.DateTimeFormat = DateTimeFormatInfo.ReadOnly(ci.DateTimeFormat);
1230  }
1231  }
1232  if (ci.textInfo != null)
1233  {
1234  cultureInfo.textInfo = TextInfo.ReadOnly(ci.textInfo);
1235  }
1236  if (ci.calendar != null)
1237  {
1238  cultureInfo.calendar = Calendar.ReadOnly(ci.calendar);
1239  }
1240  cultureInfo.m_isReadOnly = true;
1241  return cultureInfo;
1242  }
1243 
1244  private void VerifyWritable()
1245  {
1246  if (m_isReadOnly)
1247  {
1248  throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
1249  }
1250  }
1251 
1252  internal static CultureInfo GetCultureInfoHelper(int lcid, string name, string altName)
1253  {
1254  Hashtable hashtable = s_NameCachedCultures;
1255  if (name != null)
1256  {
1257  name = CultureData.AnsiToLower(name);
1258  }
1259  if (altName != null)
1260  {
1261  altName = CultureData.AnsiToLower(altName);
1262  }
1263  CultureInfo cultureInfo;
1264  if (hashtable == null)
1265  {
1266  hashtable = Hashtable.Synchronized(new Hashtable());
1267  }
1268  else
1269  {
1270  switch (lcid)
1271  {
1272  case -1:
1273  cultureInfo = (CultureInfo)hashtable[name + "�" + altName];
1274  if (cultureInfo != null)
1275  {
1276  return cultureInfo;
1277  }
1278  break;
1279  case 0:
1280  cultureInfo = (CultureInfo)hashtable[name];
1281  if (cultureInfo != null)
1282  {
1283  return cultureInfo;
1284  }
1285  break;
1286  }
1287  }
1288  Hashtable hashtable2 = s_LcidCachedCultures;
1289  if (hashtable2 == null)
1290  {
1291  hashtable2 = Hashtable.Synchronized(new Hashtable());
1292  }
1293  else if (lcid > 0)
1294  {
1295  cultureInfo = (CultureInfo)hashtable2[lcid];
1296  if (cultureInfo != null)
1297  {
1298  return cultureInfo;
1299  }
1300  }
1301  try
1302  {
1303  switch (lcid)
1304  {
1305  case -1:
1306  cultureInfo = new CultureInfo(name, altName);
1307  break;
1308  case 0:
1309  cultureInfo = new CultureInfo(name, useUserOverride: false);
1310  break;
1311  default:
1312  cultureInfo = new CultureInfo(lcid, useUserOverride: false);
1313  break;
1314  }
1315  }
1316  catch (ArgumentException)
1317  {
1318  return null;
1319  }
1320  cultureInfo.m_isReadOnly = true;
1321  if (lcid == -1)
1322  {
1323  hashtable[name + "�" + altName] = cultureInfo;
1324  cultureInfo.TextInfo.SetReadOnlyState(readOnly: true);
1325  }
1326  else
1327  {
1328  string text = CultureData.AnsiToLower(cultureInfo.m_name);
1329  hashtable[text] = cultureInfo;
1330  if ((cultureInfo.LCID != 4 || !(text == "zh-hans")) && (cultureInfo.LCID != 31748 || !(text == "zh-hant")))
1331  {
1332  hashtable2[cultureInfo.LCID] = cultureInfo;
1333  }
1334  }
1335  if (-1 != lcid)
1336  {
1337  s_LcidCachedCultures = hashtable2;
1338  }
1339  s_NameCachedCultures = hashtable;
1340  return cultureInfo;
1341  }
1342 
1350  public static CultureInfo GetCultureInfo(int culture)
1351  {
1352  if (culture <= 0)
1353  {
1354  throw new ArgumentOutOfRangeException("culture", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
1355  }
1356  CultureInfo cultureInfoHelper = GetCultureInfoHelper(culture, null, null);
1357  if (cultureInfoHelper == null)
1358  {
1359  throw new CultureNotFoundException("culture", culture, Environment.GetResourceString("Argument_CultureNotSupported"));
1360  }
1361  return cultureInfoHelper;
1362  }
1363 
1371  public static CultureInfo GetCultureInfo(string name)
1372  {
1373  if (name == null)
1374  {
1375  throw new ArgumentNullException("name");
1376  }
1377  CultureInfo cultureInfoHelper = GetCultureInfoHelper(0, name, null);
1378  if (cultureInfoHelper == null)
1379  {
1380  throw new CultureNotFoundException("name", name, Environment.GetResourceString("Argument_CultureNotSupported"));
1381  }
1382  return cultureInfoHelper;
1383  }
1384 
1393  public static CultureInfo GetCultureInfo(string name, string altName)
1394  {
1395  if (name == null)
1396  {
1397  throw new ArgumentNullException("name");
1398  }
1399  if (altName == null)
1400  {
1401  throw new ArgumentNullException("altName");
1402  }
1403  CultureInfo cultureInfoHelper = GetCultureInfoHelper(-1, name, altName);
1404  if (cultureInfoHelper == null)
1405  {
1406  throw new CultureNotFoundException("name or altName", string.Format(CurrentCulture, Environment.GetResourceString("Argument_OneOfCulturesNotSupported"), name, altName));
1407  }
1408  return cultureInfoHelper;
1409  }
1410 
1419  {
1420  if (name == "zh-CHT" || name == "zh-CHS")
1421  {
1422  throw new CultureNotFoundException("name", string.Format(CurrentCulture, Environment.GetResourceString("Argument_CultureIetfNotSupported"), name));
1423  }
1424  CultureInfo cultureInfo = GetCultureInfo(name);
1425  if (cultureInfo.LCID > 65535 || cultureInfo.LCID == 1034)
1426  {
1427  throw new CultureNotFoundException("name", string.Format(CurrentCulture, Environment.GetResourceString("Argument_CultureIetfNotSupported"), name));
1428  }
1429  return cultureInfo;
1430  }
1431 
1432  [MethodImpl(MethodImplOptions.InternalCall)]
1433  [SecurityCritical]
1434  internal static extern string nativeGetLocaleInfoEx(string localeName, uint field);
1435 
1436  [MethodImpl(MethodImplOptions.InternalCall)]
1437  [SecuritySafeCritical]
1438  internal static extern int nativeGetLocaleInfoExInt(string localeName, uint field);
1439 
1440  [MethodImpl(MethodImplOptions.InternalCall)]
1441  [SecurityCritical]
1442  internal static extern bool nativeSetThreadLocale(string localeName);
1443 
1444  [SecurityCritical]
1445  private static string GetDefaultLocaleName(int localeType)
1446  {
1447  string s = null;
1448  if (InternalGetDefaultLocaleName(localeType, JitHelpers.GetStringHandleOnStack(ref s)))
1449  {
1450  return s;
1451  }
1452  return string.Empty;
1453  }
1454 
1455  [DllImport("QCall", CharSet = CharSet.Unicode)]
1456  [SecurityCritical]
1457  [SuppressUnmanagedCodeSecurity]
1458  [return: MarshalAs(UnmanagedType.Bool)]
1459  private static extern bool InternalGetDefaultLocaleName(int localetype, StringHandleOnStack localeString);
1460 
1461  [SecuritySafeCritical]
1462  private static string GetUserDefaultUILanguage()
1463  {
1464  string s = null;
1465  if (InternalGetUserDefaultUILanguage(JitHelpers.GetStringHandleOnStack(ref s)))
1466  {
1467  return s;
1468  }
1469  return string.Empty;
1470  }
1471 
1472  [DllImport("QCall", CharSet = CharSet.Unicode)]
1473  [SecurityCritical]
1474  [SuppressUnmanagedCodeSecurity]
1475  [return: MarshalAs(UnmanagedType.Bool)]
1476  private static extern bool InternalGetUserDefaultUILanguage(StringHandleOnStack userDefaultUiLanguage);
1477 
1478  [SecuritySafeCritical]
1479  private static string GetSystemDefaultUILanguage()
1480  {
1481  string s = null;
1482  if (InternalGetSystemDefaultUILanguage(JitHelpers.GetStringHandleOnStack(ref s)))
1483  {
1484  return s;
1485  }
1486  return string.Empty;
1487  }
1488 
1489  [DllImport("QCall", CharSet = CharSet.Unicode)]
1490  [MethodImpl(MethodImplOptions.InternalCall)]
1491  [SecurityCritical]
1492  [SuppressUnmanagedCodeSecurity]
1493  [return: MarshalAs(UnmanagedType.Bool)]
1494  private static extern bool InternalGetSystemDefaultUILanguage(StringHandleOnStack systemDefaultUiLanguage);
1495  }
1496 }
static CultureInfo GetCultureInfoByIetfLanguageTag(string name)
Deprecated. Retrieves a read-only T:System.Globalization.CultureInfo object having linguistic charact...
static Thread CurrentThread
Gets the currently running thread.
Definition: Thread.cs:134
virtual object Clone()
Creates a copy of the current T:System.Globalization.CultureInfo.
virtual CultureInfo Parent
Gets the T:System.Globalization.CultureInfo that represents the parent culture of the current T:Syste...
Definition: CultureInfo.cs:275
Represents any time zone in the world.
Definition: TimeZoneInfo.cs:20
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
object Clone()
Creates a new object that is a copy of the current instance.
static CultureInfo DefaultThreadCurrentUICulture
Gets or sets the default UI culture for threads in the current application domain.
Definition: CultureInfo.cs:240
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
virtual object GetFormat(Type formatType)
Gets an object that defines how to format the specified type.
Describes a set of security permissions applied to code. This class cannot be inherited.
Represents time in divisions, such as weeks, months, and years.
Definition: Calendar.cs:11
virtual string NativeName
Gets the culture name, consisting of the language, the country/region, and the optional script,...
Definition: CultureInfo.cs:386
bool IsReadOnly
Gets a value indicating whether the current T:System.Globalization.CultureInfo is read-only.
Definition: CultureInfo.cs:635
static CultureInfo InstalledUICulture
Gets the T:System.Globalization.CultureInfo that represents the culture installed with the operating ...
Definition: CultureInfo.cs:197
Ability to use certain advanced operations on threads.
CultureTypes
Defines the types of culture lists that can be retrieved using the M:System.Globalization....
Definition: CultureTypes.cs:9
static void MemoryBarrier()
Synchronizes memory access as follows: The processor executing the current thread cannot reorder inst...
virtual CompareInfo? CompareInfo
Gets the T:System.Globalization.CompareInfo that defines how to compare strings for the culture.
Definition: CultureInfo.cs:447
CultureInfo(string name, bool useUserOverride)
Initializes a new instance of the T:System.Globalization.CultureInfo class based on the culture speci...
Definition: CultureInfo.cs:765
Represents the Gregorian calendar.
override bool Equals(object value)
Determines whether the specified object is equal to the current T:System.Globalization....
Definition: __Canon.cs:3
The exception that is thrown when the value of an argument is outside the allowable range of values a...
CultureInfo(int culture, bool useUserOverride)
Initializes a new instance of the T:System.Globalization.CultureInfo class based on the culture speci...
Definition: CultureInfo.cs:815
virtual string TwoLetterISOLanguageName
Gets the ISO 639-1 two-letter code for the language of the current T:System.Globalization....
Definition: CultureInfo.cs:412
virtual string Name
Gets the culture name in the format languagecode2-country/regioncode2.
Definition: CultureInfo.cs:321
override int GetHashCode()
Serves as a hash function for the current T:System.Globalization.CompareInfo for hashing algorithms a...
Provides a mechanism for retrieving an object to control formatting.
GregorianCalendarTypes
Defines the different language versions of the Gregorian calendar.
CultureInfo(string name)
Initializes a new instance of the T:System.Globalization.CultureInfo class based on the culture speci...
Definition: CultureInfo.cs:753
virtual string ThreeLetterISOLanguageName
Gets the ISO 639-2 three-letter code for the language of the current T:System.Globalization....
Definition: CultureInfo.cs:424
static CultureInfo ReadOnly(CultureInfo ci)
Returns a read-only wrapper around the specified T:System.Globalization.CultureInfo object.
Provides culture-specific information about the format of date and time values.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
virtual string EnglishName
Gets the culture name in the format languagefull [country/regionfull] in English.
Definition: CultureInfo.cs:399
Contains information about the country/region.
Definition: RegionInfo.cs:11
static CultureInfo DefaultThreadCurrentCulture
Gets or sets the default culture for threads in the current application domain.
Definition: CultureInfo.cs:220
static CultureInfo [] GetCultures(CultureTypes types)
Gets the list of supported cultures filtered by the specified T:System.Globalization....
virtual TextInfo TextInfo
Gets the T:System.Globalization.TextInfo that defines the writing system associated with the culture.
Definition: CultureInfo.cs:480
Represents a resource manager that provides convenient access to culture-specific resources at run ti...
static CultureInfo GetCultureInfo(int culture)
Retrieves a cached, read-only instance of a culture by using the specified culture identifier.
Represents an application domain, which is an isolated environment where applications execute....
Definition: AppDomain.cs:33
override string ToString()
Returns a string containing the name of the current T:System.Globalization.CultureInfo in the format ...
string IetfLanguageTag
Deprecated. Gets the RFC 4646 standard identification for a language.
Definition: CultureInfo.cs:353
static CultureInfo CurrentUICulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the current user interface...
Definition: CultureInfo.cs:174
static TextInfo ReadOnly(TextInfo textInfo)
Returns a read-only version of the specified T:System.Globalization.TextInfo object.
Definition: TextInfo.cs:329
SecurityAction
Specifies the security actions that can be performed using declarative security.
CultureInfo?? CurrentCulture
Gets or sets the culture for the current thread.
Definition: Thread.cs:245
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
void ClearCachedData()
Refreshes cached culture-related information.
static Calendar ReadOnly(Calendar calendar)
Returns a read-only version of the specified T:System.Globalization.Calendar object.
Definition: Calendar.cs:221
CultureInfo GetConsoleFallbackUICulture()
Gets an alternate user interface culture suitable for console applications when the default graphic u...
CultureTypes????? CultureTypes
Gets the culture types that pertain to the current T:System.Globalization.CultureInfo object.
Definition: CultureInfo.cs:515
UnmanagedType
Identifies how to marshal parameters or fields to unmanaged code.
Definition: UnmanagedType.cs:7
static int CompareExchange(ref int location1, int value, int comparand)
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
Represents a collection of key/value pairs that are organized based on the hash code of the key....
Definition: Hashtable.cs:17
Represents a time zone.
Definition: TimeZone.cs:10
virtual bool IsNeutralCulture
Gets a value indicating whether the current T:System.Globalization.CultureInfo represents a neutral c...
Definition: CultureInfo.cs:503
virtual object Clone()
Creates a new object that is a copy of the current T:System.Globalization.TextInfo object.
Definition: TextInfo.cs:316
Implements a set of methods for culture-sensitive string comparisons.
Definition: CompareInfo.cs:13
Supports cloning, which creates a new instance of a class with the same value as an existing instance...
Definition: ICloneable.cs:7
virtual int KeyboardLayoutId
Gets the active input locale identifier.
Definition: CultureInfo.cs:310
Format character that affects the layout of text or the operation of text processes,...
static NumberFormatInfo ReadOnly(NumberFormatInfo nfi)
Returns a read-only T:System.Globalization.NumberFormatInfo wrapper.
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
static Hashtable Synchronized(Hashtable table)
Returns a synchronized (thread-safe) wrapper for the T:System.Collections.Hashtable.
Definition: Hashtable.cs:1397
bool UseUserOverride
Gets a value indicating whether the current T:System.Globalization.CultureInfo object uses the user-s...
Definition: CultureInfo.cs:628
static CultureInfo GetCultureInfo(string name, string altName)
Retrieves a cached, read-only instance of a culture. Parameters specify a culture that is initialized...
MethodImplOptions
Defines the details of how a method is implemented.
CharSet
Dictates which character set marshaled strings should use.
Definition: CharSet.cs:7
static CultureInfo GetCultureInfo(string name)
Retrieves a cached, read-only instance of a culture using the specified culture name.
virtual string DisplayName
Gets the full localized culture name.
Definition: CultureInfo.cs:373
static CultureInfo CreateSpecificCulture(string name)
Creates a T:System.Globalization.CultureInfo that represents the specific culture that is associated ...
Definition: CultureInfo.cs:953
virtual Calendar [] OptionalCalendars
Gets the list of calendars that can be used by the culture.
Definition: CultureInfo.cs:611
override int GetHashCode()
Serves as a hash function for the current T:System.Globalization.CultureInfo, suitable for hashing al...
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
Definition: CultureInfo.cs:120
The exception that is thrown when one of the arguments provided to a method is not valid.
override bool Equals(object value)
Determines whether the specified object is the same culture as the current T:System....
CultureInfo(int culture)
Initializes a new instance of the T:System.Globalization.CultureInfo class based on the culture speci...
Definition: CultureInfo.cs:803
virtual string ThreeLetterWindowsLanguageName
Gets the three-letter code for the language as defined in the Windows API.
Definition: CultureInfo.cs:435
virtual DateTimeFormatInfo DateTimeFormat
Gets or sets a T:System.Globalization.DateTimeFormatInfo that defines the culturally appropriate form...
Definition: CultureInfo.cs:563
Specifies that the class can be serialized.
virtual NumberFormatInfo NumberFormat
Gets or sets a T:System.Globalization.NumberFormatInfo that defines the culturally appropriate format...
Definition: CultureInfo.cs:533
virtual Calendar Calendar
Gets the default calendar used by the culture.
Definition: CultureInfo.cs:592
The exception that is thrown when a method call is invalid for the object's current state.
virtual int LCID
Gets the culture identifier for the current T:System.Globalization.CultureInfo.
Definition: CultureInfo.cs:304
Defines text properties and behaviors, such as casing, that are specific to a writing system.
Definition: TextInfo.cs:13
static int GetDomainID()
Returns a unique application domain identifier.
Definition: Thread.cs:1108
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
Provides atomic operations for variables that are shared by multiple threads.
Definition: Interlocked.cs:10
The exception that is thrown when a method attempts to construct a culture that is not available.
CultureInfo?? CurrentUICulture
Gets or sets the current culture used by the Resource Manager to look up culture-specific resources a...
Definition: Thread.cs:199
virtual object Clone()
Creates a new object that is a copy of the current T:System.Globalization.Calendar object.
Definition: Calendar.cs:208
object Clone()
Creates a shallow copy of the T:System.Globalization.NumberFormatInfo object.
Provides culture-specific information for formatting and parsing numeric values.
static void ClearCachedData()
Clears cached time zone data.
Creates and controls a thread, sets its priority, and gets its status.
Definition: Thread.cs:18