CultureInfo.Parent プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CultureInfo.Parent プロパティの意味・解説 

CultureInfo.Parent プロパティ

現在の CultureInfo の親カルチャを表す 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 ()

プロパティ
現在の CultureInfo の親カルチャを表す CultureInfo

解説解説

カルチャは階層構造になってます。たとえば、特定のカルチャの親はニュートラル カルチャであり、ニュートラル カルチャの親は InvariantCulture であり、InvariantCulture の親はインバリアント カルチャ自体となってます。親カルチャは、その子の間で共通する情報セットだけを持ちます

システム内で特定のカルチャのリソース利用できない場合は、ニュートラル カルチャのリソース使用されます。ニュートラル カルチャのリソース利用できない場合は、メイン アセンブリ埋め込まれているリソース使用されます。リソース フォールバック プロセス詳細については、「リソースパッケージ化配置」を参照してください

Windows API のカルチャの一覧は、.NET Framework のカルチャの一覧と若干異なります。たとえば、カルチャ識別子 0x7C04 のニュートラル カルチャ zh-CHT "繁体字中国語" は Windows API では利用できません。Windows との相互運用 (たとえば、p/invoke 機構通じた相互運用) が必要な場合は、オペレーティング システム定義されている特定のカルチャを使用してください。これにより、同一の LCID で識別される等価Windows ロケールとの一貫性確保されます。

使用例使用例

中国語使用する特定の各カルチャの親カルチャを決定するコードの例次に示します

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)
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CultureInfo クラス
CultureInfo メンバ
System.Globalization 名前空間
CultureInfo
CreateSpecificCulture
CultureInfo.CurrentCulture プロパティ
CultureInfo.CurrentUICulture プロパティ
CultureInfo.InstalledUICulture プロパティ
CultureInfo.InvariantCulture プロパティ



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CultureInfo.Parent プロパティ」の関連用語

CultureInfo.Parent プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CultureInfo.Parent プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS