Muokkaa

Jaa


CultureAndRegionInfoBuilder.Parent Property

Definition

Gets or sets the CultureInfo object that represents the parent culture of the current custom culture.

public:
 property System::Globalization::CultureInfo ^ Parent { System::Globalization::CultureInfo ^ get(); void set(System::Globalization::CultureInfo ^ value); };
public System.Globalization.CultureInfo Parent { get; set; }
member this.Parent : System.Globalization.CultureInfo with get, set
Public Property Parent As CultureInfo

Property Value

The CultureInfo object that represents the parent culture of the current custom culture.

Exceptions

In a set operation, the culture value cannot be found. Possibly, the assigned value is an unregistered custom culture.

In a set operation, the value is null.

In a set operation, which traverses the ancestors of the current culture, the invariant culture cannot be found within 10 generations of ancestors.

-or-

In a set operation, a circular reference was discovered: the assigned value is an ancestor of the current custom culture.

Remarks

The cultures have a hierarchy. For predefined cultures, the parent of a specific culture is a neutral culture and the parent of a neutral culture is the InvariantCulture. The parent culture encompasses only the set of information that is common among its children.

It is generally recommended that custom cultures conform to this hierarchy. However, by default, the Parent of a custom culture is the Parent of the culture on which it is based. If the application creates a culture with CultureName "en-US-MyCulture" based on "en-US", its parent is "en" because that is the Parent of "en-US". If the application uses "en-US" as the Parent of the new custom culture, it must set this value explicitly.

If the resources for the specific culture are not available in the system, the resources for the neutral culture are used. If the resources for the neutral culture are not available, the resources embedded in the main assembly are used. For more information about the resource fallback process, see Packaging and Deploying Resources.

The list of cultures in the Windows API is slightly different from the list of cultures in the .NET Framework. If interoperability with Windows is required, for example, through the platform invoke mechanism, the application should use a specific culture that is defined in the .NET Framework. This ensures consistency with the equivalent Windows locale, which is identified with the same LCID.

Applies to