We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
-
Expand
Microsoft.Win32
-
Expand
Microsoft.Win32.SafeHandles
-
Expand
System
-
Expand
System.Runtime.Hosting
-
Expand
System.Runtime.InteropServices
-
Expand
System.Runtime.CompilerServices
-
Expand
System.Collections
-
Expand
System.Collections.Generic
-
Expand
System.Collections.ObjectModel
-
Expand
System.Configuration.Assemblies
-
Expand
System.Diagnostics
-
Expand
System.Diagnostics.CodeAnalysis
-
Expand
System.Diagnostics.SymbolStore
-
Expand
System.Globalization
-
Expand
__DateBuffer
-
Expand
BaseInfoTable
-
Expand
BidiCategory
-
Expand
Calendar
-
Expand
CalendarAlgorithmType
-
Expand
CalendarId
-
Expand
CalendarTable
-
Expand
CalendarTableData
-
Expand
CalendarWeekRule
-
Expand
CharUnicodeInfo
-
Expand
ChineseLunisolarCalendar
-
Expand
CodePageDataItem
-
Expand
CompareInfo
-
Expand
CompareOptions
-
Expand
CultureData
-
Expand
CultureFlags
-
Expand
CultureInfo
-
Calendar()
-
CheckDomainSafetyObject(object, object)
-
CheckNeutral(CultureInfo)
-
ClearCachedData()
-
Clone()
-
CompareInfo()
-
CompareInfoId()
-
CreatedDomainID()
-
CreateSpecificCulture(string)
-
CultureInfo()
-
CultureInfo(int)
-
CultureInfo(int, bool)
-
CultureInfo(string)
-
CultureInfo(string, bool)
-
CultureInfo(string, string)
-
CultureTypes()
-
CurrentCulture()
-
CurrentUICulture()
-
DateTimeFormat()
-
DisplayName()
-
EnglishName()
-
Equals(object)
-
GetCalendarInstance(int)
-
GetCalendarInstanceRare(int)
-
GetConsoleFallbackUICulture()
-
GetCultureByLCIDOrName(int, string)
-
GetCultureInfo(int)
-
GetCultureInfo(string)
-
GetCultureInfo(string, string)
-
GetCultureInfoByIetfLanguageTag(string)
-
GetCultureInfoHelper(int, string, string)
-
GetCultures(CultureTypes)
-
GetFormat(Type)
-
GetHashCode()
-
GetLangID(int)
-
GetSortID(int)
-
GetSubLangID(int)
-
IetfLanguageTag()
-
InitUserDefaultCulture()
-
InitUserDefaultUICulture()
-
InstalledUICulture()
-
InvariantCulture()
-
IsNeutralCulture()
-
IsReadOnly()
-
IsSafeCrossDomain()
-
IsValidLCID(int, int)
-
IsWin9xInstalledCulture(string, int)
-
KeyboardLayoutId()
-
LCID()
-
Name()
-
nativeEnumSystemLocales(int)
-
nativeFileExists(string)
-
nativeGetCultureData(int, CultureData)
-
nativeGetCultureName(int, bool, bool)
-
nativeGetCurrentCalendar()
-
nativeGetDTFIUserValues(int, DTFIUserOverrideValues)
-
nativeGetLocaleInfo(int, int)
-
nativeGetNFIUserValues(int, NumberFormatInfo)
-
nativeGetStaticInt32DataTable(int, int)
-
nativeGetSystemDefaultUILanguage(int)
-
nativeGetUserDefaultLCID(int, int)
-
nativeGetUserDefaultUILanguage(int)
-
nativeGetWindowsDirectory()
-
NativeName()
-
nativeSetThreadLocale(int)
-
NumberFormat()
-
OnDeserialized(StreamingContext)
-
OnSerializing(StreamingContext)
-
OptionalCalendars()
-
Parent()
-
ReadOnly(CultureInfo)
-
SortName()
-
StartCrossDomainTracking()
-
TextInfo()
-
ThreeLetterISOLanguageName()
-
ThreeLetterWindowsLanguageName()
-
ToString()
-
TwoLetterISOLanguageName()
-
UserDefaultCulture()
-
UserDefaultUICulture()
-
UseUserOverride()
-
VerifyCultureName(CultureInfo, bool)
-
VerifyWritable()
-
Expand
CultureNameOffsetItem
-
Expand
CultureTable
-
Expand
CultureTableData
-
Expand
CultureTableHeader
-
Expand
CultureTableItem
-
Expand
CultureTableRecord
-
Expand
CultureTypes
-
Expand
DateMapping
-
Expand
DateTimeFormatFlags
-
Expand
DateTimeFormatInfo
-
Expand
DateTimeFormatInfoScanner
-
Expand
DateTimeStyles
-
Expand
DaylightTime
-
Expand
DigitShapes
-
Expand
DigitValues
-
Expand
DTFIUserOverrideValues
-
Expand
EastAsianLunisolarCalendar
-
Expand
EncodingTable
-
Expand
EndianessHeader
-
Expand
EraInfo
-
Expand
ExceptionTableItem
-
Expand
FORMATFLAGS
-
Expand
FoundDatePattern
-
Expand
GlobalizationAssembly
-
Expand
GregorianCalendar
-
Expand
GregorianCalendarHelper
-
Expand
GregorianCalendarTypes
-
Expand
HebrewCalendar
-
Expand
HebrewNumber
-
Expand
HebrewNumberParsingContext
-
Expand
HebrewNumberParsingState
-
Expand
HebrewToken
-
Expand
HebrewValue
-
Expand
HijriCalendar
-
Expand
HS
-
Expand
IdnMapping
-
Expand
IDOffsetItem
-
Expand
IetfNameOffsetItem
-
Expand
InternalCodePageDataItem
-
Expand
InternalEncodingDataItem
-
Expand
JapaneseCalendar
-
Expand
JapaneseLunisolarCalendar
-
Expand
JulianCalendar
-
Expand
KoreanCalendar
-
Expand
KoreanLunisolarCalendar
-
Expand
MemoryMapFile
-
Expand
MonthNameStyles
-
Expand
NumberFormatInfo
-
Expand
NumberStyles
-
Expand
PersianCalendar
-
Expand
RegionInfo
-
Expand
RegionNameOffsetItem
-
Expand
SortKey
-
Expand
StringInfo
-
Expand
TaiwanCalendar
-
Expand
TaiwanLunisolarCalendar
-
Expand
TextElementEnumerator
-
Expand
TextInfo
-
Expand
TextInfoDataHeader
-
Expand
ThaiBuddhistCalendar
-
Expand
TokenHashValue
-
Expand
UmAlQuraCalendar
-
Expand
UnicodeCategory
-
Expand
UnicodeDataHeader
-
Expand
System.IO
-
Expand
System.IO.IsolatedStorage
-
Expand
System.Reflection
-
Expand
System.Reflection.Cache
-
Expand
System.Reflection.Emit
-
Expand
System.Resources
-
Expand
System.Runtime
-
Expand
System.Runtime.InteropServices.Expando
-
Expand
System.Runtime.ConstrainedExecution
-
Expand
System.Runtime.Remoting.Activation
-
Expand
System.Runtime.Remoting.Messaging
-
Expand
System.Runtime.Remoting.Channels
-
Expand
System.Runtime.Remoting.Lifetime
-
Expand
System.Runtime.Remoting
-
Expand
System.Runtime.Remoting.Contexts
-
Expand
System.Runtime.Remoting.Proxies
-
Expand
System.Runtime.Remoting.Metadata
-
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
-
Expand
System.Runtime.Remoting.Services
-
Expand
System.Runtime.Serialization
-
Expand
System.Runtime.Serialization.Formatters
-
Expand
System.Runtime.Serialization.Formatters.Binary
-
Expand
System.Runtime.Versioning
-
Expand
System.Security
-
Expand
System.Security.Cryptography
-
Expand
System.Security.Cryptography.X509Certificates
-
Expand
System.Security.Permissions
-
Expand
System.Security.Policy
-
Expand
System.Security.Principal
-
Expand
System.Security.Util
-
Expand
System.Text
-
Expand
System.Threading
-
Expand
System.Runtime.Remoting.Channels.Http
-
Expand
System.Runtime.Remoting.Channels.Tcp
-
Expand
System.Runtime.Remoting.MetadataServices
-
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
-
Expand
System.Runtime.Serialization.Formatters.Soap
-
Expand
Microsoft.Tools.Caspol
-
Expand
Microsoft.Tools.Build
-
Expand
Microsoft.CSharp
-
Expand
System.CodeDom
-
Expand
System.CodeDom.Compiler
-
Expand
System.Collections.Specialized
-
Expand
System.ComponentModel
-
Expand
System.ComponentModel.Design
-
Expand
System.ComponentModel.Design.Serialization
-
Expand
System.Configuration
-
Expand
System.Web
-
Expand
System.Configuration.Provider
-
Expand
System.Configuration.Internal
-
Expand
System.Internal
-
Expand
System.Windows.Forms
-
Expand
System.Net
-
Expand
System.Net.Sockets
-
Expand
System.Net.NetworkInformation
-
Expand
System.Net.ComImports
-
Expand
System.Net.Security
-
Expand
System.Net.Cache
-
Expand
System.Net.Configuration
-
Expand
System.Text.RegularExpressions
-
Expand
System.Tools
-
Expand
System.IO.Compression
-
Expand
System.IO.Ports
-
Expand
System.Security.AccessControl
-
Expand
System.Xml
-
Expand
System.Xml.XPath.DataBinding
-
Expand
System.Xml.Schema
-
Expand
System.Xml.Serialization
-
Expand
System.Xml.Serialization.Advanced
-
Expand
System.Xml.Serialization.Configuration
-
Expand
System.Xml.XPath
-
Expand
System.Xml.Xsl
-
Expand
System.Xml.Xsl.IlGen
-
Expand
System.Xml.Xsl.Qil
-
Expand
System.Xml.Xsl.Runtime
-
Expand
System.Xml.Xsl.XPath
-
Expand
System.Xml.Xsl.Xslt
-
Expand
System.Xml.Xsl.XsltOld
-
Expand
System.Xml.Xsl.XsltOld.Debugger
-
Expand
Microsoft.JScript
-
Expand
Microsoft.Vsa
-
Expand
Microsoft.JScript.Vsa
- ////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////
- namespace System.Globalization
- {
- using System;
- using System.Threading;
- using System.Collections;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Runtime.Serialization;
- using System.Security.Permissions;
- using System.Reflection;
- using Microsoft.Win32;
- using System.Runtime.Versioning;
-
- [Serializable()]
- [System.Runtime.InteropServices.ComVisible(true)]
- public class CultureInfo : ICloneable, IFormatProvider
- {
-
-
-
- internal const int zh_CHT_CultureID = 31748;
-
- internal const int sr_CultureID = 31770;
- internal const int sr_SP_Latn_CultureID = 2074;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- internal int cultureID;
- internal bool m_isReadOnly = false;
-
- internal CompareInfo compareInfo = null;
- internal TextInfo textInfo = null;
- internal NumberFormatInfo numInfo = null;
- internal DateTimeFormatInfo dateTimeInfo = null;
- internal Calendar calendar = null;
-
-
-
-
-
-
- [NonSerialized()]
- internal CultureTableRecord m_cultureTableRecord;
- [NonSerialized()]
- internal bool m_isInherited;
- [NonSerialized()]
- private bool m_isSafeCrossDomain = false;
- [NonSerialized()]
- private int m_createdDomainID = 0;
- [NonSerialized()]
- private CultureInfo m_consoleFallbackCulture = null;
-
-
-
- internal string m_name = null;
-
-
-
- [NonSerialized()]
- private string m_nonSortName = null;
-
-
-
-
- [NonSerialized()]
- private string m_sortName = null;
-
-
- [NonSerialized()]
- private string m_ietfName = null;
-
-
-
-
-
-
-
-
- private static CultureInfo m_userDefaultCulture = null;
-
-
-
-
-
-
- private static CultureInfo m_InvariantCultureInfo = null;
-
-
- private static CultureInfo m_userDefaultUICulture = null;
-
-
- private static CultureInfo m_InstalledUICultureInfo = null;
-
-
-
- private static Hashtable m_LcidCachedCultures = null;
- private static Hashtable m_NameCachedCultures = null;
- private static Hashtable m_IetfCachedCultures = null;
-
-
-
-
- [NonSerialized()]
- private CultureInfo m_parent;
-
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern bool IsValidLCID(int LCID, int flag);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern bool IsWin9xInstalledCulture(string cultureKey, int LCID);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern string nativeGetUserDefaultLCID(int* LCID, int lcidType);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern string nativeGetUserDefaultUILanguage(int* LCID);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern string nativeGetSystemDefaultUILanguage(int* LCID);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern bool nativeSetThreadLocale(int LCID);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern string nativeGetLocaleInfo(int LCID, int field);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int nativeGetCurrentCalendar();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern bool nativeGetDTFIUserValues(int lcid, ref DTFIUserOverrideValues values);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern bool nativeGetNFIUserValues(int lcid, NumberFormatInfo nfi);
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern bool nativeGetCultureData(int lcid, ref CultureData cultureData);
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern bool nativeEnumSystemLocales(out int[] localesArray);
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern string nativeGetCultureName(int lcid, bool useSNameLCType, bool getMonthName);
-
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern string nativeGetWindowsDirectory();
-
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern bool nativeFileExists(string fileName);
-
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern int* nativeGetStaticInt32DataTable(int type, out int tableSize);
-
- internal const int LOCALE_INVARIANT = 127;
- private const int LOCALE_NEUTRAL = 0;
- internal const int LOCALE_USER_DEFAULT = 1024;
- internal const int LOCALE_SYSTEM_DEFAULT = 2048;
- internal const int LOCALE_CUSTOM_DEFAULT = 3072;
- internal const int LOCALE_CUSTOM_UNSPECIFIED = 4096;
- internal const int LOCALE_TRADITIONAL_SPANISH = 1034;
- internal const int LCID_INSTALLED = 1;
- internal const int LCID_SUPPORTED = 2;
-
-
-
-
- unsafe static CultureInfo()
- {
-
- if (m_InvariantCultureInfo == null) {
- CultureInfo temp = new CultureInfo(LOCALE_INVARIANT, false);
- temp.m_isReadOnly = true;
- m_InvariantCultureInfo = temp;
- }
-
-
-
- m_userDefaultCulture = m_userDefaultUICulture = m_InvariantCultureInfo;
-
- m_userDefaultCulture = InitUserDefaultCulture();
- m_userDefaultUICulture = InitUserDefaultUICulture();
-
- }
-
- unsafe static CultureInfo InitUserDefaultCulture()
- {
- int LCID;
- string strDefault = nativeGetUserDefaultLCID(&LCID, LOCALE_USER_DEFAULT);
- CultureInfo temp = GetCultureByLCIDOrName(LCID, strDefault);
- if (temp == null) {
- strDefault = nativeGetUserDefaultLCID(&LCID, LOCALE_SYSTEM_DEFAULT);
- temp = GetCultureByLCIDOrName(LCID, strDefault);
-
- if (temp == null) {
- return (CultureInfo.InvariantCulture);
- }
- }
- temp.m_isReadOnly = true;
-
- return (temp);
- }
-
- unsafe static CultureInfo InitUserDefaultUICulture()
- {
- int LCID;
- string strDefault = nativeGetUserDefaultUILanguage(&LCID);
-
- if (LCID == UserDefaultCulture.LCID || strDefault == UserDefaultCulture.Name) {
- return (UserDefaultCulture);
- }
-
- CultureInfo temp = GetCultureByLCIDOrName(LCID, strDefault);
-
- if (temp == null) {
- strDefault = nativeGetSystemDefaultUILanguage(&LCID);
- temp = GetCultureByLCIDOrName(LCID, strDefault);
- }
-
- if (temp == null) {
- return (CultureInfo.InvariantCulture);
- }
-
- temp.m_isReadOnly = true;
-
- return (temp);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public CultureInfo(string name) : this(name, true)
- {
- }
-
-
- public CultureInfo(string name, bool useUserOverride)
- {
- if (name == null) {
- throw new ArgumentNullException("name", Environment.GetResourceString("ArgumentNull_String"));
- }
-
- this.m_cultureTableRecord = CultureTableRecord.GetCultureTableRecord(name, useUserOverride);
- this.cultureID = this.m_cultureTableRecord.ActualCultureID;
- this.m_name = this.m_cultureTableRecord.ActualName;
- this.m_isInherited = (this.GetType() != typeof(System.Globalization.CultureInfo));
- }
-
-
-
- public CultureInfo(int culture) : this(culture, true)
- {
- }
-
-
- unsafe public CultureInfo(int culture, bool useUserOverride)
- {
-
- if (culture < 0) {
- throw new ArgumentOutOfRangeException("culture", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
- }
-
- switch (culture) {
- case LOCALE_CUSTOM_DEFAULT:
- case LOCALE_SYSTEM_DEFAULT:
- case LOCALE_NEUTRAL:
- case LOCALE_USER_DEFAULT:
- case LOCALE_CUSTOM_UNSPECIFIED:
-
-
-
-
-
-
-
-
- throw new ArgumentException(Environment.GetResourceString("Argument_CultureNotSupported", culture), "culture");
- break;
- default:
- this.cultureID = culture;
-
- this.m_cultureTableRecord = CultureTableRecord.GetCultureTableRecord(this.cultureID, useUserOverride);
- this.m_name = this.m_cultureTableRecord.ActualName;
- break;
- }
- m_isInherited = (this.GetType() != typeof(System.Globalization.CultureInfo));
- }
-
-
-
-
-
-
-
- static internal void CheckDomainSafetyObject(object obj, object container)
- {
- if (obj.GetType().Assembly != typeof(System.Globalization.CultureInfo).Assembly) {
-
- throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("InvalidOperation_SubclassedObject"), obj.GetType(), container.GetType()));
- }
- }
-
- #region Serialization
-
-
- private int m_dataItem;
- private bool m_useUserOverride;
-
- [OnDeserialized()]
- private void OnDeserialized(StreamingContext ctx)
- {
-
-
-
- BCLDebug.Assert(m_name != null || cultureID > 0, "[CultureInfo.OnDeserialized] m_name != null || cultureID>0");
-
- if (m_name != null && cultureID != LOCALE_TRADITIONAL_SPANISH)
- m_cultureTableRecord = CultureTableRecord.GetCultureTableRecord(m_name, m_useUserOverride);
- else
- m_cultureTableRecord = CultureTableRecord.GetCultureTableRecord(cultureID, m_useUserOverride);
-
- m_isInherited = (this.GetType() != typeof(System.Globalization.CultureInfo));
-
- if (m_name == null) {
- m_name = m_cultureTableRecord.ActualName;
- }
-
-
-
- if (this.GetType().Assembly == typeof(System.Globalization.CultureInfo).Assembly) {
- if (textInfo != null) {
- CheckDomainSafetyObject(textInfo, this);
- }
-
- if (compareInfo != null) {
- CheckDomainSafetyObject(compareInfo, this);
- }
- }
- }
-
- [OnSerializing()]
- private void OnSerializing(StreamingContext ctx)
- {
- m_name = m_cultureTableRecord.CultureName;
- m_useUserOverride = m_cultureTableRecord.UseUserOverride;
- m_dataItem = m_cultureTableRecord.EverettDataItem();
- }
- #endregion Serialization
-
- internal bool IsSafeCrossDomain {
- get {
- BCLDebug.Assert(m_createdDomainID != 0, "[CultureInfo.IsSafeCrossDomain] m_createdDomainID != 0");
- return m_isSafeCrossDomain;
- }
- }
-
- internal int CreatedDomainID {
- get {
- BCLDebug.Assert(m_createdDomainID != 0, "[CultureInfo.CreatedDomain] m_createdDomainID != 0");
- return m_createdDomainID;
- }
- }
-
- internal void StartCrossDomainTracking()
- {
-
-
- if (m_createdDomainID != 0)
- return;
-
- if (this.GetType() == typeof(System.Globalization.CultureInfo)) {
- m_isSafeCrossDomain = true;
- }
-
-
-
- System.Threading.Thread.MemoryBarrier();
- m_createdDomainID = Thread.GetDomainID();
- }
-
-
-
-
-
-
-
- internal CultureInfo(string cultureName, string textAndCompareCultureName)
- {
- if (cultureName == null) {
- throw new ArgumentNullException("cultureName", Environment.GetResourceString("ArgumentNull_String"));
- }
-
- this.m_cultureTableRecord = CultureTableRecord.GetCultureTableRecord(cultureName, false);
- this.cultureID = this.m_cultureTableRecord.ActualCultureID;
- this.m_name = this.m_cultureTableRecord.ActualName;
-
- CultureInfo altCulture = GetCultureInfo(textAndCompareCultureName);
-
- this.compareInfo = altCulture.CompareInfo;
- this.textInfo = altCulture.TextInfo;
- }
-
-
-
-
-
-
-
-
-
-
-
- private static CultureInfo GetCultureByLCIDOrName(int preferLCID, string fallbackToString)
- {
-
- CultureInfo culture = null;
-
-
-
- if ((preferLCID & 1023) != 0) {
-
- try {
- culture = new CultureInfo(preferLCID);
- }
- catch (ArgumentException) {
- }
- }
-
- if (culture == null && fallbackToString != null && fallbackToString.Length > 0) {
-
- try {
- culture = new CultureInfo(fallbackToString);
- }
- catch (ArgumentException) {
- }
- }
-
- return culture;
- }
-
-
-
- public static CultureInfo CreateSpecificCulture(string name)
- {
- CultureInfo culture;
-
- try {
- culture = new CultureInfo(name);
- }
- catch (ArgumentException exp) {
-
-
-
-
- int idx;
-
- culture = null;
- for (idx = 0; idx < name.Length; idx++) {
- if ('-' == name[idx]) {
- try {
- culture = new CultureInfo(name.Substring(0, idx));
- break;
- }
- catch (ArgumentException) {
-
- throw (exp);
- }
- }
- }
-
- if (null == culture) {
-
- throw (exp);
- }
- }
-
-
- if (!(culture.IsNeutralCulture)) {
- return culture;
- }
-
- int lcid = culture.LCID;
-
-
-
- if ((lcid & 1023) == 4) {
- throw new ArgumentException(Environment.GetResourceString("Argument_NoSpecificCulture"));
- }
-
- return (new CultureInfo(culture.m_cultureTableRecord.SSPECIFICCULTURE));
- }
-
- static internal bool VerifyCultureName(CultureInfo culture, bool throwException)
- {
- BCLDebug.Assert(culture != null, "[CultureInfo.VerifyCultureName]culture!=null");
-
-
-
- if (!culture.m_isInherited) {
- return true;
- }
-
-
-
-
- string name = culture.Name;
-
- for (int i = 0; i < name.Length; i++) {
- char c = name[i];
- if (Char.IsLetterOrDigit(c) || c == '-' || c == '_') {
- continue;
- }
- if (throwException) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidResourceCultureName", name));
- }
- return false;
- }
- return true;
- }
-
-
-
-
-
- static internal int GetSubLangID(int culture)
- {
- return ((culture >> 10) & 63);
- }
-
- static internal int GetLangID(int culture)
- {
- return (culture & 65535);
- }
-
- static internal int GetSortID(int lcid)
- {
- return ((lcid >> 16) & 15);
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public static CultureInfo CurrentCulture {
- get { return Thread.CurrentThread.CurrentCulture; }
- }
-
-
-
-
- static internal CultureInfo UserDefaultCulture {
- get {
- CultureInfo temp = m_userDefaultCulture;
- if (temp == null) {
-
-
-
-
-
-
- m_userDefaultCulture = CultureInfo.InvariantCulture;
- temp = InitUserDefaultCulture();
- m_userDefaultCulture = temp;
- }
- return (temp);
- }
- }
-
-
-
-
- unsafe static internal CultureInfo UserDefaultUICulture {
- get {
- CultureInfo temp = m_userDefaultUICulture;
- if (temp == null) {
-
-
-
-
-
-
- m_userDefaultUICulture = CultureInfo.InvariantCulture;
-
- temp = InitUserDefaultUICulture();
- m_userDefaultUICulture = temp;
- }
- return (temp);
- }
- }
-
-
- public static CultureInfo CurrentUICulture {
- get { return Thread.CurrentThread.CurrentUICulture; }
- }
-
-
-
-
-
- unsafe public static CultureInfo InstalledUICulture {
- get {
- CultureInfo temp = m_InstalledUICultureInfo;
- if (temp == null) {
- int LCID;
- string strDefault = nativeGetSystemDefaultUILanguage(&LCID);
- temp = GetCultureByLCIDOrName(LCID, strDefault);
-
- if (temp == null) {
- temp = new CultureInfo(LOCALE_INVARIANT, true);
- }
-
- temp.m_isReadOnly = true;
- m_InstalledUICultureInfo = temp;
- }
- return (temp);
- }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public static CultureInfo InvariantCulture {
- get { return (m_InvariantCultureInfo); }
- }
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
- public virtual CultureInfo Parent {
- get {
- if (null == m_parent) {
- try {
- int parentCulture = this.m_cultureTableRecord.IPARENT;
- if (parentCulture == LOCALE_INVARIANT) {
- m_parent = InvariantCulture;
- }
- else if (CultureTableRecord.IsCustomCultureId(parentCulture)) {
-
- m_parent = new CultureInfo(this.m_cultureTableRecord.SPARENT);
- }
- else {
- m_parent = new CultureInfo(parentCulture, this.m_cultureTableRecord.UseUserOverride);
- }
- }
- catch (ArgumentException) {
-
-
-
- m_parent = InvariantCulture;
- }
- }
- return m_parent;
- }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual int LCID {
- get { return (this.cultureID); }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public virtual int KeyboardLayoutId {
- get {
- int keyId = this.m_cultureTableRecord.IINPUTLANGUAGEHANDLE;
-
-
- return (keyId);
- }
- }
-
-
- public static CultureInfo[] GetCultures(CultureTypes types)
- {
- return (CultureTable.Default.GetCultures(types));
- }
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
- public virtual string Name {
- get {
-
- if (this.m_nonSortName == null) {
- this.m_nonSortName = this.m_cultureTableRecord.CultureName;
- }
- return this.m_nonSortName;
- }
- }
-
-
- internal string SortName {
- get {
- if (this.m_sortName == null) {
- if (CultureTableRecord.IsCustomCultureId(cultureID)) {
- CultureInfo sortCI = CultureInfo.GetCultureInfo(CompareInfoId);
-
- BCLDebug.Assert(!CultureTableRecord.IsCustomCultureId(sortCI.cultureID), "[CultureInfo.SortName]Expected non-custom sort id");
-
- if (CultureTableRecord.IsCustomCultureId(sortCI.cultureID)) {
-
-
- this.m_sortName = m_cultureTableRecord.SNAME;
- }
- else {
- this.m_sortName = sortCI.SortName;
-
- }
- }
- else {
-
- BCLDebug.Assert(m_name != null, "[CultureInfo.SortName]Always expect m_name to be set");
- this.m_sortName = this.m_name;
-
- }
- }
- return this.m_sortName;
- }
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public string IetfLanguageTag {
- get {
- if (this.m_ietfName == null) {
- this.m_ietfName = this.m_cultureTableRecord.SIETFTAG;
- }
-
-
- return this.m_ietfName;
- }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual string DisplayName {
- get {
- BCLDebug.Assert(m_name != null, "[CultureInfo.DisplayName]Always expect m_name to be set");
-
- if (m_cultureTableRecord.IsCustomCulture) {
- if (m_cultureTableRecord.IsReplacementCulture) {
-
- if (m_cultureTableRecord.IsSynthetic)
- return m_cultureTableRecord.CultureNativeDisplayName;
- else
- return (Environment.GetResourceString("Globalization.ci_" + this.m_name));
- }
- else {
- return m_cultureTableRecord.SNATIVEDISPLAYNAME;
- }
- }
- else {
-
- if (m_cultureTableRecord.IsSynthetic)
- return m_cultureTableRecord.CultureNativeDisplayName;
- else
- return (Environment.GetResourceString("Globalization.ci_" + this.m_name));
- }
- }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual string NativeName {
- get { return (this.m_cultureTableRecord.SNATIVEDISPLAYNAME); }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual string EnglishName {
- get { return (this.m_cultureTableRecord.SENGDISPLAYNAME); }
- }
-
-
- public virtual string TwoLetterISOLanguageName {
- get { return (this.m_cultureTableRecord.SISO639LANGNAME); }
- }
-
-
- public virtual string ThreeLetterISOLanguageName {
- get { return (this.m_cultureTableRecord.SISO639LANGNAME2); }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual string ThreeLetterWindowsLanguageName {
- get { return (this.m_cultureTableRecord.SABBREVLANGNAME); }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual CompareInfo CompareInfo {
- get {
- if (compareInfo == null) {
-
- CompareInfo temp;
-
-
- if (IsNeutralCulture && !CultureTableRecord.IsCustomCultureId(cultureID))
- temp = CompareInfo.GetCompareInfo(cultureID);
- else
- temp = CompareInfo.GetCompareInfo(CompareInfoId);
-
-
- temp.SetName(this.SortName);
- compareInfo = temp;
-
- }
- return (compareInfo);
- }
- }
-
- internal int CompareInfoId {
- get {
- int compareId;
-
- if (this.cultureID == LOCALE_TRADITIONAL_SPANISH) {
-
-
- compareId = LOCALE_TRADITIONAL_SPANISH;
- }
- else if (GetSortID(this.cultureID) != 0) {
-
-
- compareId = this.cultureID;
- }
- else {
- compareId = unchecked((int)this.m_cultureTableRecord.ICOMPAREINFO);
- }
-
- return compareId;
- }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual TextInfo TextInfo {
- get {
- if (textInfo == null) {
-
- TextInfo tempTextInfo = new TextInfo(this.m_cultureTableRecord);
- tempTextInfo.SetReadOnlyState(m_isReadOnly);
- textInfo = tempTextInfo;
- }
- return (textInfo);
- }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public override bool Equals(object value)
- {
- if (Object.ReferenceEquals(this, value))
- return true;
-
- CultureInfo that = value as CultureInfo;
-
- if (that != null) {
-
-
-
- return (this.Name.Equals(that.Name) && this.CompareInfo.Equals(that.CompareInfo));
- }
-
- return (false);
- }
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public override int GetHashCode()
- {
- return (this.Name.GetHashCode() + this.CompareInfo.GetHashCode());
- }
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public override string ToString()
- {
- BCLDebug.Assert(m_name != null, "[CultureInfo.ToString]Always expect m_name to be set");
- return m_name;
- }
-
-
- public virtual object GetFormat(Type formatType)
- {
- if (formatType == typeof(NumberFormatInfo)) {
- return (NumberFormat);
- }
- if (formatType == typeof(DateTimeFormatInfo)) {
- return (DateTimeFormat);
- }
- return (null);
- }
-
- static internal void CheckNeutral(CultureInfo culture)
- {
- if (culture.IsNeutralCulture) {
- BCLDebug.Assert(culture.m_name != null, "[CultureInfo.CheckNeutral]Always expect m_name to be set");
- throw new NotSupportedException(Environment.GetResourceString("Argument_CultureInvalidFormat", culture.m_name));
- }
- }
-
- public virtual bool IsNeutralCulture {
- get { return this.m_cultureTableRecord.IsNeutralCulture; }
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public CultureTypes CultureTypes {
- get {
- CultureTypes types = 0;
-
- if (m_cultureTableRecord.IsNeutralCulture)
- types |= CultureTypes.NeutralCultures;
- else
- types |= CultureTypes.SpecificCultures;
-
- if (m_cultureTableRecord.IsSynthetic)
- types |= CultureTypes.WindowsOnlyCultures | CultureTypes.InstalledWin32Cultures;
-
- else {
-
- if (CultureTable.IsInstalledLCID(cultureID))
- types |= CultureTypes.InstalledWin32Cultures;
-
- if (!m_cultureTableRecord.IsCustomCulture || m_cultureTableRecord.IsReplacementCulture)
- types |= CultureTypes.FrameworkCultures;
- }
-
- if (m_cultureTableRecord.IsCustomCulture) {
- types |= CultureTypes.UserCustomCulture;
-
- if (m_cultureTableRecord.IsReplacementCulture)
- types |= CultureTypes.ReplacementCultures;
- }
-
-
- return types;
- }
- }
-
- public virtual NumberFormatInfo NumberFormat {
- get {
- CultureInfo.CheckNeutral(this);
- if (numInfo == null) {
- NumberFormatInfo temp = new NumberFormatInfo(this.m_cultureTableRecord);
- temp.isReadOnly = m_isReadOnly;
- numInfo = temp;
- }
- return (numInfo);
- }
- set {
- VerifyWritable();
- if (value == null) {
- throw new ArgumentNullException("value", Environment.GetResourceString("ArgumentNull_Obj"));
- }
- numInfo = value;
- }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual DateTimeFormatInfo DateTimeFormat {
- get {
- if (dateTimeInfo == null) {
- CultureInfo.CheckNeutral(this);
-
- DateTimeFormatInfo temp = new DateTimeFormatInfo(this.m_cultureTableRecord, GetLangID(cultureID), this.Calendar);
- temp.m_isReadOnly = m_isReadOnly;
- System.Threading.Thread.MemoryBarrier();
- dateTimeInfo = temp;
- }
- return (dateTimeInfo);
- }
-
- set {
- VerifyWritable();
- if (value == null) {
- throw new ArgumentNullException("value", Environment.GetResourceString("ArgumentNull_Obj"));
- }
- dateTimeInfo = value;
- }
- }
-
-
-
- unsafe public void ClearCachedData()
- {
- m_userDefaultUICulture = null;
- m_userDefaultCulture = null;
-
- RegionInfo.m_currentRegionInfo = null;
-
- TimeZone.ResetTimeZone();
-
-
- m_LcidCachedCultures = null;
- m_NameCachedCultures = null;
- m_IetfCachedCultures = null;
-
- CultureTableRecord.ResetCustomCulturesCache();
- CompareInfo.ClearDefaultAssemblyCache();
- }
-
-
- static internal Calendar GetCalendarInstance(int calType)
- {
- if (calType == Calendar.CAL_GREGORIAN) {
- return (new GregorianCalendar());
- }
- return GetCalendarInstanceRare(calType);
- }
-
-
-
- static internal Calendar GetCalendarInstanceRare(int calType)
- {
- BCLDebug.Assert(calType != Calendar.CAL_GREGORIAN, "calType!=Calendar.CAL_GREGORIAN");
-
- switch (calType) {
- case Calendar.CAL_GREGORIAN_US:
- case Calendar.CAL_GREGORIAN_ME_FRENCH:
- case Calendar.CAL_GREGORIAN_ARABIC:
- case Calendar.CAL_GREGORIAN_XLIT_ENGLISH:
- case Calendar.CAL_GREGORIAN_XLIT_FRENCH:
-
-
-
-
-
- return (new GregorianCalendar((GregorianCalendarTypes)calType));
- case Calendar.CAL_TAIWAN:
-
- return (new TaiwanCalendar());
- case Calendar.CAL_JAPAN:
-
- return (new JapaneseCalendar());
- case Calendar.CAL_KOREA:
-
- return (new KoreanCalendar());
- case Calendar.CAL_HIJRI:
-
- return (new HijriCalendar());
- case Calendar.CAL_THAI:
-
- return (new ThaiBuddhistCalendar());
- case Calendar.CAL_HEBREW:
-
- return (new HebrewCalendar());
- case Calendar.CAL_PERSIAN:
- return (new PersianCalendar());
- case Calendar.CAL_UMALQURA:
- return (new UmAlQuraCalendar());
- case Calendar.CAL_CHINESELUNISOLAR:
- return (new ChineseLunisolarCalendar());
- case Calendar.CAL_JAPANESELUNISOLAR:
- return (new JapaneseLunisolarCalendar());
- case Calendar.CAL_KOREANLUNISOLAR:
- return (new KoreanLunisolarCalendar());
- case Calendar.CAL_TAIWANLUNISOLAR:
- return (new TaiwanLunisolarCalendar());
- }
- return (new GregorianCalendar());
- }
-
-
-
-
-
- public virtual Calendar Calendar {
- get {
- if (calendar == null) {
- BCLDebug.Assert(this.m_cultureTableRecord.IOPTIONALCALENDARS.Length > 0, "this.m_cultureTableRecord.IOPTIONALCALENDARS.Length > 0");
-
-
- int calType = this.m_cultureTableRecord.ICALENDARTYPE;
-
- Calendar newObj = GetCalendarInstance(calType);
- System.Threading.Thread.MemoryBarrier();
- newObj.SetReadOnlyState(m_isReadOnly);
- calendar = newObj;
- }
- return (calendar);
- }
- }
-
-
-
-
- public virtual Calendar[] OptionalCalendars {
- get {
-
-
-
- int[] calID = this.m_cultureTableRecord.IOPTIONALCALENDARS;
- Calendar[] cals = new Calendar[calID.Length];
- for (int i = 0; i < cals.Length; i++) {
- cals[i] = GetCalendarInstance(calID[i]);
- }
- return (cals);
- }
- }
-
-
- public bool UseUserOverride {
- get { return (this.m_cultureTableRecord.UseUserOverride); }
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public CultureInfo GetConsoleFallbackUICulture()
- {
- CultureInfo temp = m_consoleFallbackCulture;
- if (temp == null) {
- temp = GetCultureInfo(this.m_cultureTableRecord.SCONSOLEFALLBACKNAME);
- temp.m_isReadOnly = true;
- m_consoleFallbackCulture = temp;
- }
- return (temp);
- }
-
-
- public virtual object Clone()
- {
- CultureInfo ci = (CultureInfo)MemberwiseClone();
- ci.m_isReadOnly = false;
-
- if (!ci.IsNeutralCulture) {
-
-
- if (!m_isInherited) {
- if (dateTimeInfo != null) {
- ci.dateTimeInfo = (DateTimeFormatInfo)dateTimeInfo.Clone();
- }
- if (numInfo != null) {
- ci.numInfo = (NumberFormatInfo)numInfo.Clone();
- }
-
- }
- else {
- ci.DateTimeFormat = (DateTimeFormatInfo)this.DateTimeFormat.Clone();
- ci.NumberFormat = (NumberFormatInfo)this.NumberFormat.Clone();
- }
- }
-
- if (textInfo != null) {
- ci.textInfo = (TextInfo)textInfo.Clone();
- }
-
- if (calendar != null) {
- ci.calendar = (Calendar)calendar.Clone();
- }
-
- return (ci);
- }
-
-
- public static CultureInfo ReadOnly(CultureInfo ci)
- {
- if (ci == null) {
- throw new ArgumentNullException("ci");
- }
- if (ci.IsReadOnly) {
- return (ci);
- }
- CultureInfo info = (CultureInfo)(ci.MemberwiseClone());
-
- if (!ci.IsNeutralCulture) {
-
-
- if (!ci.m_isInherited) {
- if (ci.dateTimeInfo != null) {
- info.dateTimeInfo = DateTimeFormatInfo.ReadOnly(ci.dateTimeInfo);
- }
- if (ci.numInfo != null) {
- info.numInfo = NumberFormatInfo.ReadOnly(ci.numInfo);
- }
-
- }
- else {
- info.DateTimeFormat = DateTimeFormatInfo.ReadOnly(ci.DateTimeFormat);
- info.NumberFormat = NumberFormatInfo.ReadOnly(ci.NumberFormat);
- }
- }
-
- if (ci.textInfo != null) {
- info.textInfo = TextInfo.ReadOnly(ci.textInfo);
- }
-
- if (ci.calendar != null) {
- info.calendar = Calendar.ReadOnly(ci.calendar);
- }
-
-
-
- info.m_isReadOnly = true;
-
- return (info);
- }
-
-
- public bool IsReadOnly {
- get { return (m_isReadOnly); }
- }
-
- private void VerifyWritable()
- {
- if (m_isReadOnly) {
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
- }
- }
-
-
-
-
- static internal CultureInfo GetCultureInfoHelper(int lcid, string name, string altName)
- {
-
- CultureInfo retval;
-
-
- Hashtable tempNameHT = m_NameCachedCultures;
-
- if (name != null)
- name = CultureTableRecord.AnsiToLower(name);
-
- if (altName != null)
- altName = CultureTableRecord.AnsiToLower(altName);
-
-
- if (tempNameHT == null) {
- tempNameHT = new Hashtable();
- }
- else {
-
- if (lcid == -1) {
- retval = (CultureInfo)tempNameHT[name + '�' + altName];
- if (retval != null) {
- return retval;
- }
- }
- else if (lcid == 0) {
- retval = (CultureInfo)tempNameHT[name];
- if (retval != null) {
- return retval;
- }
- }
- }
-
-
- Hashtable tempLcidHT = m_LcidCachedCultures;
-
- if (tempLcidHT == null) {
-
- tempLcidHT = new Hashtable();
- }
- else {
-
- if (lcid > 0) {
- retval = (CultureInfo)tempLcidHT[lcid];
- if (retval != null) {
- return retval;
- }
- }
- }
-
-
- Hashtable tempIetfHT = m_IetfCachedCultures;
-
- if (tempIetfHT == null) {
- tempIetfHT = new Hashtable();
- }
- else {
-
- if (lcid == -2) {
- retval = (CultureInfo)tempIetfHT[name];
- if (retval != null) {
- return retval;
- }
- }
- }
-
-
-
- try {
- switch (lcid) {
- case -2:
-
- {
-
- string cultureName = CultureTableRecord.GetCultureNameFromIetfName(name);
- if (cultureName == null)
- return null;
- retval = new CultureInfo(cultureName, false);
- break;
- }
- break;
- case -1:
-
-
- retval = new CultureInfo(name, altName);
- break;
- case 0:
-
- retval = new CultureInfo(name, false);
- break;
- default:
-
-
-
-
-
-
-
-
-
-
- if (m_userDefaultCulture != null && m_userDefaultCulture.LCID == lcid) {
- retval = (CultureInfo)m_userDefaultCulture.Clone();
- retval.m_cultureTableRecord = retval.m_cultureTableRecord.CloneWithUserOverride(false);
- }
- else {
- retval = new CultureInfo(lcid, false);
- }
- break;
- }
- }
- catch (ArgumentException) {
- return null;
- }
-
-
- retval.m_isReadOnly = true;
-
- if (lcid == -1) {
-
- tempNameHT[name + '�' + altName] = retval;
-
-
- retval.TextInfo.SetReadOnlyState(true);
- }
- else {
-
- tempLcidHT[retval.LCID] = retval;
-
- string newName = CultureTableRecord.AnsiToLower(retval.m_name);
-
- tempNameHT[newName] = retval;
-
- newName = retval.IetfLanguageTag;
- if (newName != null) {
- newName = CultureTableRecord.AnsiToLower(newName);
- tempIetfHT[newName] = retval;
- }
-
- if (lcid == -2 && !name.Equals(newName))
- tempIetfHT[name] = retval;
-
- }
-
-
-
-
- if (-1 != lcid) {
-
- m_LcidCachedCultures = tempLcidHT;
- m_IetfCachedCultures = tempIetfHT;
- }
-
- m_NameCachedCultures = tempNameHT;
-
-
- return retval;
- }
-
-
-
- public static CultureInfo GetCultureInfo(int culture)
- {
-
-
-
- if (culture <= 0) {
- throw new ArgumentOutOfRangeException("culture", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
- }
-
- CultureInfo retval = GetCultureInfoHelper(culture, null, null);
- if (null == retval) {
- throw new ArgumentException(Environment.GetResourceString("Argument_CultureNotSupported", culture), "culture");
- }
- return retval;
-
- }
-
-
-
- public static CultureInfo GetCultureInfo(string name)
- {
-
- if (name == null) {
- throw new ArgumentNullException("name");
- }
-
- CultureInfo retval = GetCultureInfoHelper(0, name, null);
- if (retval == null) {
- throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_InvalidCultureName"), name), "name");
- }
- return retval;
- }
-
-
-
- public static CultureInfo GetCultureInfo(string name, string altName)
- {
-
- if (null == name) {
- throw new ArgumentNullException("name");
- }
-
- if (null == altName) {
- throw new ArgumentNullException("altName");
- }
-
- CultureInfo retval = GetCultureInfoHelper(-1, name, altName);
- if (retval == null) {
- throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_OneOfCulturesNotSupported"), name, altName), "name");
- }
- return retval;
- }
-
-
- public static CultureInfo GetCultureInfoByIetfLanguageTag(string name)
- {
-
- if (null == name) {
- throw new ArgumentNullException("name");
- }
-
- CultureInfo retval = GetCultureInfoHelper(-2, name, null);
- if (null == retval) {
- throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_CultureIetfNotSupported"), name), "name");
- }
-
- return retval;
- }
-
-
- }
- }