Windows apps
Collapse the table of content
Expand the table of content
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 Value

Type: System.Globalization.CultureInfo
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.

The following example determines the parent culture of each specific culture that uses the Chinese language.


using System;
using System.Globalization;

public class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {
      // Displays the header.
      outputBlock.FontFamily = new System.Windows.Media.FontFamily("Courier New");
      outputBlock.Text += "SPECIFIC CULTURE                             PARENT CULTURE" + "\n";

      // Create an array of Chinese culture names.
      string[] cultureNames = { "zh-CN", "zh-Hans", "zh-Hant", "zh-HK",  
                                "zh-MO", "zh-SG", "zh-TW", };

      // Determines the specific cultures that use the Chinese language, and displays the parent culture.
      foreach (string cultureName in cultureNames)
      {
         CultureInfo ci = new CultureInfo(cultureName);
         outputBlock.Text += String.Format("{0,-7} {1,-37}", ci.Name, ci.EnglishName);
         outputBlock.Text += String.Format("{0,-7} {1}\n", ci.Parent.Name, ci.Parent.EnglishName);
      }
   }
}
/*
This example produces the following output.

SPECIFIC CULTURE                             PARENT CULTURE
zh-CN   Chinese (People's Republic of China) zh-Hans Chinese 
zh-Hans Chinese                                      Invariant Language (Invariant Country)
zh-Hant Chinese                                      Invariant Language (Invariant Country)
zh-HK   Chinese (Hong Kong S.A.R.)           zh-Hant Chinese 
zh-MO   Chinese (Macao S.A.R.)               zh-Hant Chinese 
zh-SG   Chinese (Singapore)                  zh-Hans Chinese 
zh-TW   Chinese (Taiwan)                     zh-Hant Chinese 
*/


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

Show:
© 2016 Microsoft