CultureAndRegionInfoBuilder::Parent Property
Gets or sets the CultureInfo object that represents the parent culture of the current custom culture.
Assembly: sysglobl (in sysglobl.dll)
public: property CultureInfo^ Parent { CultureInfo^ get (); void set (CultureInfo^ value); }
Property Value
Type: System.Globalization::CultureInfoThe CultureInfo object that represents the parent culture of the current custom culture.
| Exception | Condition |
|---|---|
| InvalidOperationException | In a set operation, the culture value cannot be found. Possibly, the assigned value is an unregistered custom culture. |
| ArgumentNullException | In a set operation, the value is nullptr. |
| ArgumentException | 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. |
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.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
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.