CultureInfo.Parent CultureInfo.Parent CultureInfo.Parent CultureInfo.Parent Property

定義

現在の CultureInfo の親カルチャを表す CultureInfo を取得します。Gets the CultureInfo that represents the parent culture of the current CultureInfo.

public:
 virtual property System::Globalization::CultureInfo ^ Parent { System::Globalization::CultureInfo ^ get(); };
public virtual System.Globalization.CultureInfo Parent { get; }
member this.Parent : System.Globalization.CultureInfo
Public Overridable ReadOnly Property Parent As CultureInfo

プロパティ値

現在の CultureInfo の親カルチャを表す CultureInfoThe CultureInfo that represents the parent culture of the current CultureInfo.

次のコード例では、各体字中国語の言語を使用して特定のカルチャの親カルチャを決定します。The following code example determines the parent culture of each specific culture using the Chinese language.

注意

この例では、zh-CHS および zh-CHT の古いカルチャ名を、カルチャ識別子としてそれぞれ 0x0004 と 0x7C04 を使用して表示します。The example displays the older zh-CHS and zh-CHT culture names with the 0x0004 and 0x7C04 culture identifiers, respectively. ただし、Windows Vista アプリケーションでは、ZH-CHS および ZH-CHT のではなく Zh-hant 名ではなく Zh-hans 名を使用する必要があります。However, your Windows Vista applications should use the zh-Hans name instead of zh-CHS and the zh-Hant name instead of zh-CHT. Zh-hans および Zh-hant 名は、現在の標準を表すし、古い名前を使用する理由がないために使用する必要があります。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 namespace System;
using namespace System::Globalization;
int main()
{
   
   // Prints the header.
   Console::WriteLine( "SPECIFIC CULTURE                                     PARENT CULTURE" );
   
   // Determines the specific cultures that use the Chinese language, 
   // and displays the parent culture.
   System::Collections::IEnumerator^ en = CultureInfo::GetCultures( CultureTypes::SpecificCultures )->GetEnumerator();
   while ( en->MoveNext() )
   {
      CultureInfo^ ci = safe_cast<CultureInfo^>(en->Current);
      if ( ci->TwoLetterISOLanguageName->Equals( "zh" ) )
      {
         Console::Write( "0x{0} {1} {2,-40}", 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 (Traditional, Taiwan)           0x7C04 zh-CHT Chinese (Traditional) Legacy
0x0804 zh-CN Chinese (Simplified, PRC)               0x0004 zh-CHS Chinese (Simplified) Legacy
0x0C04 zh-HK Chinese (Traditional, Hong Kong S.A.R.) 0x7C04 zh-CHT Chinese (Traditional) Legacy
0x1004 zh-SG Chinese (Simplified, Singapore)         0x0004 zh-CHS Chinese (Simplified) Legacy
0x1404 zh-MO Chinese (Traditional, Macao S.A.R.)     0x7C04 zh-CHT Chinese (Traditional) Legacy

*/
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,-40}", 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 (Traditional, Taiwan)           0x7C04 zh-CHT Chinese (Traditional) Legacy
0x0804 zh-CN Chinese (Simplified, PRC)               0x0004 zh-CHS Chinese (Simplified) Legacy
0x0C04 zh-HK Chinese (Traditional, Hong Kong S.A.R.) 0x7C04 zh-CHT Chinese (Traditional) Legacy
0x1004 zh-SG Chinese (Simplified, Singapore)         0x0004 zh-CHS Chinese (Simplified) Legacy
0x1404 zh-MO Chinese (Traditional, Macao S.A.R.)     0x7C04 zh-CHT Chinese (Traditional) Legacy

*/
Imports System
Imports System.Globalization

Module Module1

    Public Sub Main()

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

        ' Determines the specific cultures that use the Chinese language, and displays the parent culture.
        Dim ci As CultureInfo
        For Each ci In CultureInfo.GetCultures(CultureTypes.SpecificCultures)
            If ci.TwoLetterISOLanguageName = "zh" Then
                Console.Write("0x{0} {1} {2,-40}", 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)
            End If
        Next ci

    End Sub 'Main 



'This code produces the following output.
'
'SPECIFIC CULTURE                                     PARENT CULTURE
'0x0404 zh-TW Chinese (Traditional, Taiwan)           0x7C04 zh-CHT Chinese (Traditional) Legacy
'0x0804 zh-CN Chinese (Simplified, PRC)               0x0004 zh-CHS Chinese (Simplified) Legacy
'0x0C04 zh-HK Chinese (Traditional, Hong Kong S.A.R.) 0x7C04 zh-CHT Chinese (Traditional) Legacy
'0x1004 zh-SG Chinese (Simplified, Singapore)         0x0004 zh-CHS Chinese (Simplified) Legacy
'0x1404 zh-MO Chinese (Traditional, Macao S.A.R.)     0x7C04 zh-CHT Chinese (Traditional) Legacy

End Module

注釈

階層があるカルチャ ニュートラル カルチャの親は、特定のカルチャの親がニュートラル カルチャをInvariantCultureとの親、InvariantCulture自体インバリアント カルチャです。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. リソース フォールバック プロセスの詳細については、次を参照してください。 Packaging and Deploying Resourcesします。For more information on the resource fallback process, see Packaging and Deploying Resources.

適用対象

こちらもご覧ください