CultureAndRegionInfoBuilder::Register Method ()
Persists the current CultureAndRegionInfoBuilder object as a custom culture on the local computer and makes that culture available to applications. Requires administrative privileges.
Assembly: sysglobl (in sysglobl.dll)
| Exception | Condition |
|---|---|
| InvalidOperationException | The custom culture is already registered. -or- The current CultureAndRegionInfoBuilder object has a property that must be set before the culture can be registered. All cultures, neutral or specific, must have TextInfo and CompareInfo set. Specific cultures must also have NumberFormat, GregorianDateTimeFormat, and AvailableCalendars set. This method also throws InvalidOperationException if the following properties are not defined: |
| ArgumentOutOfRangeException | A CultureAndRegionInfoBuilder object property value exceeds its maximum length or value. |
| UnauthorizedAccessException | User does not have administrative privileges. |
The Register method stores a custom culture as a file on the local computer, in the Globalization subdirectory of the directory returned by the Win32 GetWindowsDirectory function. This process is called registering the custom culture. After the custom culture is registered, a new custom culture can be created by specifying the culture name in a CultureInfo constructor or when calling the CultureInfo::CreateSpecificCulture method.
The custom culture can be removed by calling the Unregister method.
Available since 2.0