다음을 통해 공유


CultureInfo.Parent 속성

현재 CultureInfo의 부모 culture를 나타내는 CultureInfo를 가져옵니다.

네임스페이스: System.Globalization
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Overridable ReadOnly Property Parent As CultureInfo
‘사용 방법
Dim instance As CultureInfo
Dim value As CultureInfo

value = instance.Parent
public virtual CultureInfo Parent { get; }
public:
virtual property CultureInfo^ Parent {
    CultureInfo^ get ();
}
/** @property */
public CultureInfo get_Parent ()
public function get Parent () : CultureInfo

속성 값

현재 CultureInfo의 부모 culture를 나타내는 CultureInfo입니다.

설명

culture의 계층 구조는 특정 culture의 부모가 중립 culture이고 중립 culture의 부모가 InvariantCulture이며 InvariantCulture의 부모가 고정 culture 자체인 방식으로 구성됩니다. 부모 culture는 해당 자식 항목 간에 공통되는 정보 집합만 포함합니다.

특정 culture의 리소스를 시스템에서 사용할 수 없으면 중립 culture의 리소스가 사용됩니다. 중립 culture의 리소스도 사용할 수 없으면 주 어셈블리에 포함된 리소스가 사용됩니다. 리소스 대체 프로세스에 대한 자세한 내용은 리소스 패키징 및 배포를 참조하십시오.

Windows API의 culture 목록은 .NET Framework의 culture 목록과 약간 다릅니다. 예를 들어, culture 식별자가 0x7C04인 중립 culture zh-CHT "중국어(번체)"는 Windows API에서 사용할 수 없습니다. 예를 들어, 플랫폼 호출 메커니즘 등을 통해 Windows와 상호 운용하려면 운영 체제에 정의된 특정 culture를 사용합니다. 이렇게 하면 동일한 LCID로 식별되는 해당 Windows 로캘과의 일관성이 유지됩니다.

예제

다음 코드 예제에서는 중국어를 사용하는 각 특정 culture의 부모 culture를 확인합니다.

Imports System
Imports System.Globalization

Public Class SamplesCultureInfo

   Public Shared 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,-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)
         End If
      Next ci

   End Sub 'Main 

End Class 'SamplesCultureInfo

'This code produces the following output.
'
'SPECIFIC CULTURE                                  PARENT CULTURE
'0x0404 zh-TW Chinese (Taiwan)                     0x7C04 zh-CHT Chinese (Traditional)
'0x0804 zh-CN Chinese (People's Republic of China) 0x0004 zh-CHS Chinese (Simplified)
'0x0C04 zh-HK Chinese (Hong Kong S.A.R.)           0x7C04 zh-CHT Chinese (Traditional)
'0x1004 zh-SG Chinese (Singapore)                  0x0004 zh-CHS Chinese (Simplified)
'0x1404 zh-MO Chinese (Macau S.A.R.)               0x7C04 zh-CHT Chinese (Traditional)
'
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-CHT Chinese (Traditional)
0x0804 zh-CN Chinese (People's Republic of China) 0x0004 zh-CHS Chinese (Simplified)
0x0C04 zh-HK Chinese (Hong Kong S.A.R.)           0x7C04 zh-CHT Chinese (Traditional)
0x1004 zh-SG Chinese (Singapore)                  0x0004 zh-CHS Chinese (Simplified)
0x1404 zh-MO Chinese (Macau S.A.R.)               0x7C04 zh-CHT Chinese (Traditional)

*/
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,-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-CHT Chinese (Traditional)
0x0804 zh-CN Chinese (People's Republic of China) 0x0004 zh-CHS Chinese (Simplified)
0x0C04 zh-HK Chinese (Hong Kong S.A.R.)           0x7C04 zh-CHT Chinese (Traditional)
0x1004 zh-SG Chinese (Singapore)                  0x0004 zh-CHS Chinese (Simplified)
0x1404 zh-MO Chinese (Macao S.A.R.)               0x0004 zh-CHS Chinese (Simplified)

*/
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-CHT Chinese 
(Traditional)
0x0804 zh-CN Chinese (People's Republic of China) 0x0004 zh-CHS Chinese 
(Simplified)
0x0C04 zh-HK Chinese (Hong Kong S.A.R.)           0x7C04 zh-CHT Chinese 
(Traditional)
0x1004 zh-SG Chinese (Singapore)                  0x0004 zh-CHS Chinese 
(Simplified)
0x1404 zh-MO Chinese (Macau S.A.R.)               0x0004 zh-CHS Chinese 
(Simplified)
*/

플랫폼

Windows 98, Windows 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

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

CultureInfo 클래스
CultureInfo 멤버
System.Globalization 네임스페이스
CultureInfo
CreateSpecificCulture
CultureInfo.CurrentCulture 속성
CultureInfo.CurrentUICulture 속성
CultureInfo.InstalledUICulture 속성
CultureInfo.InvariantCulture 속성