NeutralResourcesLanguageAttributeとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > NeutralResourcesLanguageAttributeの意味・解説 

NeutralResourcesLanguageAttribute クラス

アセンブリニュートラル カルチャの ResourceManager を通知します。このクラス継承できません。

名前空間: System.Resources
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
<AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple:=False)>
 _
Public NotInheritable Class
 NeutralResourcesLanguageAttribute
    Inherits Attribute
Dim instance As NeutralResourcesLanguageAttribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=false)]
 
public sealed class NeutralResourcesLanguageAttribute
 : Attribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets::Assembly, AllowMultiple=false)]
 
public ref class NeutralResourcesLanguageAttribute
 sealed : public Attribute
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=false)
 */ 
public final class NeutralResourcesLanguageAttribute
 extends Attribute
ComVisibleAttribute(true) 
AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=false)
 
public final class NeutralResourcesLanguageAttribute
 extends Attribute
解説解説
使用例使用例

NeutralResourcesLanguageAttribute クラス使用する例を次に示します

Imports System
Imports System.Resources
Imports System.Globalization
Imports System.Threading



<assembly: NeutralResourcesLanguageAttribute("de",
 UltimateResourceFallbackLocation.Satellite)>
 

Public Class Demo
   
    Public Overloads Shared
 Sub Main(ByVal args() As
 String)

        ' If a specific culture is passed in through the command line,
 use that -- otherwise
        ' just use the current ui culture
        Dim strCulture As String
 = ""
        If args.Length = 1 Then
            strCulture = args(0)
        End If
        If strCulture <> ""
 Then
            Try
                Thread.CurrentThread.CurrentUICulture = New CultureInfo(strCulture)
            Catch e As ArgumentException
                Console.WriteLine(e.Message, "Bad command-line
 argument")
            End Try
        Else
            Console.WriteLine("Current culture is: {0}",
 CultureInfo.CurrentUICulture.ToString())
        End If
        Dim rm As ResourceManager

        Try
            rm = New ResourceManager("MyStrings",
 GetType(Demo).Assembly)
            Dim attr As New
 NeutralResourcesLanguageAttribute("de", UltimateResourceFallbackLocation.Satellite)
            Console.WriteLine(("Neutral language = "
 + rm.GetString("Language") + ",
 Fallback location = " + attr.Location.ToString() + ", Fallback culture = " + attr.CultureName.ToString()))
            Console.WriteLine(rm.GetString("MSG"))

        Catch e As MissingSatelliteAssemblyException
            Console.WriteLine(e.Message, "Unable to locate satellite
 Assembly")
        End Try
    End Sub 'Main 
End Class 'Demo 


using System;
using System.Resources;
using System.Globalization;
using System.Threading;

[assembly: NeutralResourcesLanguageAttribute("de" , UltimateResourceFallbackLocation.Satellite)]

public class Demo
{
        public static void
 Main(string[] args) {
            
            // If a specific culture is passed in through the command
 line, use that -- otherwise
            // just use the current ui culture
        
            String strCulture = "";
            if (args.Length == 1) 
            {
                strCulture = args[0];
            }
        if (strCulture != "") 
        {
            try {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(strCulture);
            }
            catch (ArgumentException e){
                Console.WriteLine(e.Message, "Bad command-line argument");
            }
        }
        else
            Console.WriteLine("Current culture is: {0}", CultureInfo.CurrentUICulture.ToString());

        ResourceManager rm;

        try
        {
            rm = new ResourceManager("MyStrings", typeof(Demo).Assembly);
            NeutralResourcesLanguageAttribute attr = new NeutralResourcesLanguageAttribute("de",
 UltimateResourceFallbackLocation.Satellite);
            Console.WriteLine("Neutral language = " + rm.GetString("Language")
 + ", Fallback location = " + attr.Location.ToString() + ", Fallback
 culture = " + attr.CultureName.ToString());
            Console.WriteLine(rm.GetString("MSG"));

        }
        catch (MissingSatelliteAssemblyException e){
            Console.WriteLine(e.Message, "Unable to locate satellite Assembly");
        }



        }

}
using namespace System;
using namespace System::Resources;
using namespace System::Globalization;
using namespace System::Threading;

[assembly:NeutralResourcesLanguageAttribute("de",UltimateResourceFallbackLocation::Satellite)];
public ref class Demo
{
public:
   int FallbackDemo()
   {
      array<String^>^args = Environment::GetCommandLineArgs();
      
      // If a specific culture is passed in through the command line,
 use that -- otherwise
      // just use the current ui culture
      String^ strCulture = L"";
      if ( args->Length == 1 )
      {
         strCulture = args[ 0 ];
      }

      if (  !strCulture->Equals( L"" ) )
      {
         try
         {
            Thread::CurrentThread->CurrentUICulture = gcnew CultureInfo( strCulture
 );
         }
         catch ( ArgumentException^ e ) 
         {
            Console::WriteLine( e->Message, L"Bad command-line argument"
 );
         }

      }
      else
            Console::WriteLine( L"Current culture is: {0}", CultureInfo::CurrentUICulture
 );

      ResourceManager^ rm;
      try
      {
         
         rm = gcnew ResourceManager( L"MyStrings",Demo::typeid->Assembly
 );
         NeutralResourcesLanguageAttribute^ attr = gcnew NeutralResourcesLanguageAttribute(
 L"de",UltimateResourceFallbackLocation::Satellite );
         
         Console::WriteLine( L"Neutral language = {0}, Fallback location = {1},
 Fallback culture = {2}", rm->GetString( L"Language" ), attr->Location,
 attr->CultureName );
         Console::WriteLine( rm->GetString( L"MSG" ) );
      }
      catch ( MissingSatelliteAssemblyException^ e ) 
      {
         Console::WriteLine( e->Message, L"Unable to locate satellite Assembly"
 );
      }

      return 1;
   }

};

void main()
{
   Demo^ d = gcnew Demo;
   d->FallbackDemo();
}

import System.*;
import System.Resources.*;
import System.Globalization.*;
import System.Threading.*;

/** @assembly NeutralResourcesLanguageAttribute("de",
    UltimateResourceFallbackLocation.Satellite)
 */
public class Demo
{
    public static void main(String[]
 args)
    {
        // If a specific culture is passed in through the command line,
 use
        // that -- otherwise just use the current ui culture
        String strCulture = "";
        if (args.get_Length() == 1) {
            strCulture = args[0];
        }
        if (!(strCulture.Equals(""))) {
            try {
                System.Threading.Thread.get_CurrentThread().
                    set_CurrentUICulture(new CultureInfo(strCulture));
            }
            catch (ArgumentException e) {
                Console.WriteLine(e.get_Message(), "Bad command-line argument");
            }
        }
        else {
            Console.WriteLine("Current culture is: {0}",
                CultureInfo.get_CurrentUICulture().ToString());
        }
        ResourceManager rm;
        try {
            rm = new ResourceManager("MyStrings",
                Demo.class.ToType().get_Assembly());
            NeutralResourcesLanguageAttribute attr = 
                new NeutralResourcesLanguageAttribute("de"
,
                UltimateResourceFallbackLocation.Satellite);
            Console.WriteLine("Neutral language = " 
                + rm.GetString("Language") + ", Fallback location
 = " 
                + attr.get_Location().ToString() + ", Fallback culture = "
 
                + attr.get_CultureName().ToString());
            Console.WriteLine(rm.GetString("MSG"));
        }
        catch (MissingSatelliteAssemblyException e) {
            Console.WriteLine(e.get_Message(),
                "Unable to locate satellite Assembly");
        }
    } //main
} //Demo
継承階層継承階層
System.Object
   System.Attribute
    System.Resources.NeutralResourcesLanguageAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
NeutralResourcesLanguageAttribute メンバ
System.Resources 名前空間
UltimateResourceFallbackLocation
FallbackLocation
その他の技術情報
リソースパッケージ化配置

NeutralResourcesLanguageAttribute コンストラクタ (String, UltimateResourceFallbackLocation)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定した最終的なリソース フォールバック位置で、NeutralResourcesLanguageAttribute クラス新しインスタンス初期化します。

名前空間: System.Resources
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    cultureName As String, _
    location As UltimateResourceFallbackLocation _
)
Dim cultureName As String
Dim location As UltimateResourceFallbackLocation

Dim instance As New NeutralResourcesLanguageAttribute(cultureName,
 location)
public NeutralResourcesLanguageAttribute (
    string cultureName,
    UltimateResourceFallbackLocation location
)
public:
NeutralResourcesLanguageAttribute (
    String^ cultureName, 
    UltimateResourceFallbackLocation location
)
public NeutralResourcesLanguageAttribute (
    String cultureName, 
    UltimateResourceFallbackLocation location
)
public function NeutralResourcesLanguageAttribute
 (
    cultureName : String, 
    location : UltimateResourceFallbackLocation
)

パラメータ

cultureName

現在のアセンブリニュートラル リソース書き込まれたカルチャの名前。

location

ニュートラル フォールバック リソース取得する所を示す UltimateResourceFallbackLocation 列挙体値。

例外例外
例外種類条件

ArgumentNullException

cultureNamenull 参照 (Visual Basic では Nothing) です。

ArgumentException

locationUltimateResourceFallbackLocationメンバではありません。

解説解説

NeutralResourcesLanguageAttribute コンストラクタUltimateResourceFallbackLocation 列挙と共に使用して、ResourceManager クラスニュートラル フォールバック リソースメイン アプリケーション アセンブリ (既定) から取得するか、または CurrentUICulture プロパティおよび FallbackLocation プロパティによって指定されサテライト アセンブリから取得するかを指定します

カルチャの有効な名前の詳細については、「CultureInfo」を参照してください

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
NeutralResourcesLanguageAttribute クラス
NeutralResourcesLanguageAttribute メンバ
System.Resources 名前空間
UltimateResourceFallbackLocation
FallbackLocation
その他の技術情報
リソースパッケージ化配置

NeutralResourcesLanguageAttribute コンストラクタ (String)

NeutralResourcesLanguageAttribute クラス新しインスタンス初期化します。

名前空間: System.Resources
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    cultureName As String _
)
Dim cultureName As String

Dim instance As New NeutralResourcesLanguageAttribute(cultureName)
public NeutralResourcesLanguageAttribute (
    string cultureName
)
public:
NeutralResourcesLanguageAttribute (
    String^ cultureName
)
public NeutralResourcesLanguageAttribute (
    String cultureName
)
public function NeutralResourcesLanguageAttribute
 (
    cultureName : String
)

パラメータ

cultureName

現在のアセンブリニュートラル リソース書き込まれたカルチャの名前。

例外例外
例外種類条件

ArgumentNullException

cultureName パラメータnull 参照 (Visual Basic では Nothing) です。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
NeutralResourcesLanguageAttribute クラス
NeutralResourcesLanguageAttribute メンバ
System.Resources 名前空間

NeutralResourcesLanguageAttribute コンストラクタ

NeutralResourcesLanguageAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
NeutralResourcesLanguageAttribute (String) NeutralResourcesLanguageAttribute クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

NeutralResourcesLanguageAttribute (String, UltimateResourceFallbackLocation) 指定した最終的なリソース フォールバック位置で、NeutralResourcesLanguageAttribute クラス新しインスタンス初期化します。
参照参照

関連項目

NeutralResourcesLanguageAttribute クラス
NeutralResourcesLanguageAttribute メンバ
System.Resources 名前空間

NeutralResourcesLanguageAttribute プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

NeutralResourcesLanguageAttribute クラス
System.Resources 名前空間
UltimateResourceFallbackLocation
FallbackLocation

その他の技術情報

リソースパッケージ化配置

NeutralResourcesLanguageAttribute メソッド


パブリック メソッドパブリック メソッド

  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 ( Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
参照参照

関連項目

NeutralResourcesLanguageAttribute クラス
System.Resources 名前空間
UltimateResourceFallbackLocation
FallbackLocation

その他の技術情報

リソースパッケージ化配置

NeutralResourcesLanguageAttribute メンバ

アセンブリニュートラル カルチャの ResourceManager を通知します。このクラス継承できません。

NeutralResourcesLanguageAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド NeutralResourcesLanguageAttribute オーバーロードされます。 NeutralResourcesLanguageAttribute クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 (Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
参照参照

関連項目

NeutralResourcesLanguageAttribute クラス
System.Resources 名前空間
UltimateResourceFallbackLocation
FallbackLocation

その他の技術情報

リソースパッケージ化配置


このページでは「.NET Framework クラス ライブラリ リファレンス」からNeutralResourcesLanguageAttributeを検索した結果を表示しています。
Weblioに収録されているすべての辞書からNeutralResourcesLanguageAttributeを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からNeutralResourcesLanguageAttribute を検索

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

辞書ショートカット

すべての辞書の索引

「NeutralResourcesLanguageAttribute」の関連用語

NeutralResourcesLanguageAttributeのお隣キーワード
検索ランキング

   

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



NeutralResourcesLanguageAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS