Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CultureInfo.Parent Property

Gets the CultureInfo that represents the parent culture of the current CultureInfo.

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)

public virtual CultureInfo Parent { get; }
/** @property */
public CultureInfo get_Parent ()

public function get Parent () : CultureInfo

Not applicable.

Property Value

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

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

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 on the resource fallback process, see Packaging and Deploying Resources.

The following code example determines the parent culture of each specific culture using the Chinese language.

NoteNote:

The example displays the zh-CHS and zh-CHT cultures with the 0x0004 and 0x7C04 culture identifiers, respectively. However, your Windows Vista applications should use the "zh-Hans" name instead of "zh-CHS" and the "zh-Hant" name instead of "zh-CHT". The "zh-Hans" and "zh-Hant" names represent the current standard, and should be used unless you have a reason for using the older names.

using System;
using System.Globalization;

public class SamplesCultureInfo  {

   public static void Main()  {

      // Prints the header.
      Console.WriteLine( "SPECIFIC CULTURE                                  PARENT CULTURE" );

      // Determines the specific cultures that use the Chinese language, and displays the parent culture.
      foreach ( CultureInfo ci in CultureInfo.GetCultures( CultureTypes.SpecificCultures ) )  {
         if ( ci.TwoLetterISOLanguageName == "zh" )  {
            Console.Write( "0x{0} {1} {2,-37}", ci.LCID.ToString("X4"), ci.Name, ci.EnglishName );
            Console.WriteLine( "0x{0} {1} {2}", ci.Parent.LCID.ToString("X4"), ci.Parent.Name, ci.Parent.EnglishName );
         }
      }

   }

}

/*
This code produces the following output.

SPECIFIC CULTURE                                  PARENT CULTURE
0x0404 zh-TW Chinese (Taiwan)                     0x7C04 zh-Hant Chinese (Traditional)
0x0804 zh-CN Chinese (People's Republic of China) 0x0004 zh-Hans Chinese (Simplified)
0x0C04 zh-HK Chinese (Hong Kong S.A.R.)           0x7C04 zh-Hant Chinese (Traditional)
0x1004 zh-SG Chinese (Singapore)                  0x0004 zh-Hans Chinese (Simplified)
0x1404 zh-MO Chinese (Macau S.A.R.)               0x7C04 zh-Hant Chinese (Traditional)

*/

import System.* ;
import System.Globalization.* ;

public class SamplesCultureInfo
{
    public static void main(String[] args)
    {
        // Prints the header.
        Console.WriteLine("SPECIFIC CULTURE                                " 
            + "  PARENT CULTURE");

        // Determines the specific cultures that use the Chinese language, 
        // and displays the parent culture.
        for(int iCtr=0;
            iCtr < (CultureInfo.GetCultures(CultureTypes.SpecificCultures).
                length); iCtr++) {
            CultureInfo ci = 
                CultureInfo.GetCultures(CultureTypes.SpecificCultures)[iCtr];
            if (ci.get_TwoLetterISOLanguageName().equalsIgnoreCase("zh")) {
                Console.Write("0x{0} {1} {2,-37}", 
                    ((System.Int32 ) ci.get_LCID()).ToString("X4") , 
                    ci.get_Name(), ci.get_EnglishName());
                Console.WriteLine("0x{0} {1} {2}", 
                    ((System.Int32 )ci.get_Parent().get_LCID()).ToString("X4"),
                    ci.get_Parent().get_Name(), 
                    ci.get_Parent().get_EnglishName());
            }
        }
    } //main
} //SamplesCultureInfo

/*
This code produces the following output.

SPECIFIC CULTURE                                  PARENT CULTURE
0x0404 zh-TW Chinese (Taiwan)                     0x7C04 zh-Hant Chinese 
(Traditional)
0x0804 zh-CN Chinese (People's Republic of China) 0x0004 zh-Hans Chinese 
(Simplified)
0x0C04 zh-HK Chinese (Hong Kong S.A.R.)           0x7C04 zh-Hant Chinese 
(Traditional)
0x1004 zh-SG Chinese (Singapore)                  0x0004 zh-Hans Chinese 
(Simplified)
0x1404 zh-MO Chinese (Macau S.A.R.)               0x0004 zh-Hans Chinese 
(Simplified)
*/

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0

Community Additions

Show:
© 2014 Microsoft