This topic has not yet been rated - Rate this topic

CultureAndRegionInfoBuilder Class

Defines a custom culture that is new or based on another culture and country/region. The custom culture can be installed on a computer and subsequently used by any application running on that computer. This class cannot be inherited.

System.Object
  System.Globalization.CultureAndRegionInfoBuilder

Namespace:  System.Globalization
Assembly:  sysglobl (in sysglobl.dll)
[ComVisibleAttribute(false)]
public sealed class CultureAndRegionInfoBuilder

The CultureAndRegionInfoBuilder type exposes the following members.

  Name Description
Public method CultureAndRegionInfoBuilder Initializes a new instance of the CultureAndRegionInfoBuilder class.
Top
  Name Description
Public property AvailableCalendars Gets or sets an array of calendars that are supported by this CultureAndRegionInfoBuilder object.
Public property CompareInfo Gets or sets the CompareInfo object that defines how to compare strings for the culture.
Public property ConsoleFallbackUICulture Gets or sets an alternate user interface culture suitable for console applications when the default graphic user interface culture is inappropriate.
Public property CultureEnglishName Gets or sets the culture name in English.
Public property CultureName Gets the name of the culture being created.
Public property CultureNativeName Gets or sets the culture name in the format and language that the culture is set to display.
Public property CultureTypes Gets the CultureTypes value that describes the culture represented by the current CultureAndRegionInfoBuilder object.
Public property CurrencyEnglishName Gets or sets the name, in English, of the currency used in the country/region represented by the current CultureAndRegionInfoBuilder object.
Public property CurrencyNativeName Gets or sets the native name of the currency used in the country/region represented by the current CultureAndRegionInfoBuilder object.
Public property GeoId Gets or sets a unique identification number for a geographical region, country, city, or location.
Public property GregorianDateTimeFormat Gets or sets a DateTimeFormatInfo object that defines the format of dates and times according to the Gregorian calendar.
Public property IetfLanguageTag Gets or sets a culture name formatted according to the RFC 4646 standard, "Tags for the Identification of Languages."
Public property IsMetric Gets or sets a value indicating whether the country/region uses the metric system for measurements.
Public property ISOCurrencySymbol Gets or sets the three-character ISO 4217 currency symbol associated with the country/region.
Public property IsRightToLeft Gets or sets the predominant direction of lines of text in the writing system associated with the current CultureAndRegionInfoBuilder object.
Public property KeyboardLayoutId Gets or sets the active input locale identifier.
Public property LCID Gets the culture identifier for the current CultureAndRegionInfoBuilder object.
Public property NumberFormat Gets or sets a NumberFormatInfo object that defines the culturally appropriate format of displaying numbers, currency, and percentage.
Public property Parent Gets or sets the CultureInfo object that represents the parent culture of the current custom culture.
Public property RegionEnglishName Gets or sets the full name of the country/region in English.
Public property RegionName Gets the name of the country/region for the current CultureAndRegionInfoBuilder object.
Public property RegionNativeName Gets or sets the full name of the country/region as known by the people of this custom culture.
Public property TextInfo Gets or sets the TextInfo object that defines the writing system associated with this custom culture.
Public property ThreeLetterISOLanguageName Gets or sets the ISO 639-2 three-letter code for the language of this custom culture.
Public property ThreeLetterISORegionName Gets or sets the three-letter code defined in ISO 3166 for the country/region.
Public property ThreeLetterWindowsLanguageName Gets or sets the three-letter code for the language as defined in the Windows API.
Public property ThreeLetterWindowsRegionName Gets or sets the three-letter code assigned by Windows to the country/region represented by the current custom culture.
Public property TwoLetterISOLanguageName Gets or sets the ISO 639-1 two-letter code for the language of the current CultureInfo object.
Public property TwoLetterISORegionName Gets or sets the two-letter code defined in ISO 3166 for the country/region.
Top
  Name Description
Public method Static member CreateFromLdml Reconstitutes a CultureAndRegionInfoBuilder object from a specified XML file that contains a representation of the object.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method LoadDataFromCultureInfo Sets the properties of the current CultureAndRegionInfoBuilder object with the corresponding properties of the specified CultureInfo object.
Public method LoadDataFromRegionInfo Sets the properties of the current CultureAndRegionInfoBuilder object with the corresponding properties of the specified RegionInfo object.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Register Persists the current CultureAndRegionInfoBuilder object as a custom culture on the local computer and makes that culture available to applications. Requires administrative privileges.
Public method Save Writes an XML representation of the current CultureAndRegionInfoBuilder object to the specified file.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Static member Unregister Deletes a custom culture from the local computer.
Top

The CultureInfo class holds culture-specific information, such as the associated language, sublanguage, country/region, calendar, and cultural conventions. This class also provides culture-specific instances of the DateTimeFormatInfo, NumberFormatInfo, CompareInfo, and TextInfo classes, which are required for culture-specific operations such as casing, formatting and parsing dates and numbers, and comparing strings.

However, only the cultures predefined in the CultureInfo class are available to applications. The application should use the CultureAndRegionInfoBuilder class to create a custom culture that is new or overrides a predefined culture, and to install the custom culture on a computer. An installed custom culture is said to be registered on a computer, and can be used by any application running on that computer.

Note that a custom culture can be registered on a computer only by a user who has administrative rights on that computer. Consequently, typical applications cannot create a custom culture. Instead, the application uses the CultureAndRegionInfoBuilder class to build a tool that an administrator can use to create and register a custom culture. After the custom culture is registered on a computer, the application uses the CultureInfo class to create an instance of the custom culture just as it would a predefined culture.

If your application parses a date and time string generated for a custom culture, it should use the TryParseExact method instead of the TryParse method to improve the probability that the parse operation will succeed. A custom culture date and time string can be complicated, and therefore difficult to parse. The TryParse method attempts to parse a string with several implicit parse patterns, all of which might fail. The TryParseExact method, in contrast, requires the application to explicitly designate one or more exact parse patterns that are likely to succeed.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Explicit reference needed to sysglobl.dll
Imports or Using System.Globalization does not work.

Need to explicitly add reference to sysglobl.dll as suggested earlier/above.

I found this for Vs2010 Professional vb.net and c#
not sure about other languages or vs2010 versions.
Class Not Present

This class is not present in Visual C# 2010 Express. This should be documented (or the missing class re-added).

The Class Is Present!

Unlike most of the types in the System.Globalization namespace, the CultureAndRegionInfoBuilder class is defined in the sysglobl assembly. So in order to use it, you have to add a reference to sysglobl.dll to your project when you're using Visual C# 2010 Express.

--Ron Petrusha
Common Language Runtime Developer Content
Microsoft Corporation