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

ResourceManager クラス

カルチャ固有のリソースに、実行時簡単にアクセスできるようにします。

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

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Class ResourceManager
Dim instance As ResourceManager
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public class ResourceManager
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public ref class ResourceManager
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public class ResourceManager
SerializableAttribute 
ComVisibleAttribute(true) 
public class ResourceManager
解説解説

ResourceManager クラスは、カルチャ固有のリソース検索しローカライズされたリソース存在しない場合代替となるリソース提供しリソースシリアル化サポートします

ResourceManagerメソッド使用すると、呼び出し元は GetObject メソッドと GetString メソッド使用して特定カルチャのリソースアクセスできるようになります既定では、これらのメソッドは、呼び出したスレッド現在のカルチャ設定決定されているカルチャに固有のリソース返します詳細については、Thread.CurrentUICulture のトピック参照してください呼び出し元で ResourceManager.GetResourceSet メソッド使用すると、カルチャ フォールバック規則無視し特定のカルチャのリソースを表す ResourceSet を取得できます取得した ResourceSet使用して、そのカルチャ用にローカライズされているリソースに名前でアクセスできます

理想的には、すべての言語リソース作成する必要があります。または、少なくとも 1 つ言語わかりやすいサブセット作成する必要がありますリソース ファイル名は basename.cultureName.resources の名前付け規則従いますbasename は、アプリケーション名か、実行単位によって異なりますが、クラス名です。CultureInfo の Name プロパティ使用して cultureName が決定されます。ニュートラル カルチャ (InvariantCulture で返されます) に使用するリソースの名前は、basename.resources にする必要があります

たとえば、アセンブリ複数リソースがあり、これがリソース ファイル格納されていて、リソース ファイルbasename"MyResources" だと想定します。これらのリソース ファイルの名前は、"MyResources.ja-JP.resources""MyResources.de.resources""MyResources.zh-CHS.resources""MyResources.fr-BE.resources"どのようになり、日本語ドイツ語繁体字中国語フランス語 (ベルギー) の各リソース含まれます。既定リソース ファイルの名前は MyResources.resources です。カルチャ固有のリソース ファイルは、通常、カルチャごとのサテライト アセンブリパッケージ化されます既定リソース ファイルメイン アセンブリ入れる必要があります

この basename を持つリソースを表すために ResourceManager作成されているとしますResourceManager使用して"MyResources.ja-JP.resources"カプセル化する ResourceSet取得できます。この場合は、GetResourceSet(new CultureInfo ("ja-JP"), TRUE, FALSE) のようにメソッド呼び出します。また、"MyResources""TOOLBAR_ICON" という名前のリソース含まれていることがわかっている場合は、日本語ローカライズしたこのリソースの値を取得できます。この場合は、GetObject("TOOLBAR_ICON", new CultureInfo("ja-JP")) のようにメソッド呼び出します。

ResourceManager のほとんどの基本的な用途では必ずしも必要ではありませんが、一般に出荷するアセンブリでは、SatelliteContractVersionAttribute を使用してサテライト再配置せずにメイン アセンブリバージョン管理サポートし、NeutralResourcesLanguageAttribute を使用して存在しないサテライト アセンブリ検索防止する必要があります

サテライト アセンブリバージョン管理サポート詳細については、サテライト アセンブリ含まれるリソース取得トピック参照してくださいサテライト アセンブリ作成詳細については、「サテライト アセンブリ作成」を参照してくださいWindows フォーム ダイアログローカリゼーション支援については、Microsoft .NET Framework SDK の「Windows フォーム リソース エディタ (Winres.exe)」ツール参照してください

リソース設定作成詳細については、「アプリケーションリソース」を参照してください

注意に関するメモメモ

<satelliteassemblies> ノード作成する代わりにClickOnce 配置マニフェスト 機能使用することもできます

次のコード例に従って構成ファイル セクション作成します

<?xml version ="1.0"?>
<configuration>
    <satelliteassemblies>
        <assembly name="MainAssemblyName, Version=versionNumber, Culture=neutral,
 PublicKeyToken=null|yourPublicKeyToken">
            <culture>cultureName1</culture>
            <culture>cultureName2</culture>
            <culture>cultureName3</culture>
        </assembly>
    </satelliteassemblies>
</configuration>

構成ファイル内で次の作業行います

<satelliteassemblies> ノード列挙されていないアセンブリリソース必要な場合ResourceManager クラスは、標準調査規則に従ってカルチャを調査します

使用例使用例

明示的なカルチャと現在の暗黙UI カルチャを使用してメイン アセンブリサテライト アセンブリから文字列リソース取得するコード例次に示します詳細については、「サテライト アセンブリ作成」のサブトピック「グローバル アセンブリ キャッシュ内にインストールしないサテライト アセンブリ用のディレクトリ位置」を参照してください

' This code example demonstrates the ResourceManager() 
' constructor and ResourceManager.GetString() method.

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

'
'Perform the following steps to use this code example:
'
'Main assembly:
'1) In a main directory, create a file named "rmc.txt" that
 
'contains the following resource strings:
'
'day=Friday
'year=2006
'holiday="Cinco de Mayo"
'
'2) Use the resgen.exe tool to generate the "rmc.resources"
 
'resource file from the "rmc.txt" input file.
'
'> resgen rmc.txt
'
'Satellite Assembly:
'3) Create a subdirectory of the main directory and name the 
'subdirectory "es-ES", which is the culture name of the 
'satellite assembly.
'
'4) Create a file named "rmc.es-ES.txt" that contains the
 
'following resource strings:
'
'day=Viernes
'year=2006
'holiday="Cinco de Mayo"
'
'5) Use the resgen.exe tool to generate the "rmc.es-ES.resources"
 
'resource file from the "rmc.es-ES.txt" input file.
'
'> resgen rmc.es-ES.txt
'
'6) Use the al.exe tool to create a satellite assembly. If the 
'base name of the application is "rmc", the satellite assembly
 
'name must be "rmc.resources.dll". Also, specify the culture,
 
'which is es-ES.
'
'> al /embed:rmc.es-ES.resources /c:es-ES /out:rmc.resources.dll
 
'
'7) Assume the filename for this code example is "rmc.vb".
 Compile 
'rmc.vb and embed the main assembly resource file, rmc.resources, in
 
'the executable assembly, rmc.exe:
'
'>vbc /res:rmc.resources rmc.vb
'
'8) Execute rmc.exe, which obtains and displays the embedded 
'resource strings.
'

Class Sample
    Public Shared Sub Main()
 
        Dim day As String
        Dim year As String
        Dim holiday As String
        Dim celebrate As String
 = "{0} will occur on {1} in {2}." & vbCrLf
        
        ' Create a resource manager. The GetExecutingAssembly() method
        ' gets rmc.exe as an Assembly object.
        Dim rm As New ResourceManager("rmc",
 [Assembly].GetExecutingAssembly())
        
        ' Obtain resources using the current UI culture.
        Console.WriteLine("Obtain resources using the current
 UI culture.")
        
        ' Get the resource strings for the day, year, and holiday 
        ' using the current UI culture. Use those strings to 
        ' display a message.
        day = rm.GetString("day")
        year = rm.GetString("year")
        holiday = rm.GetString("holiday")
        Console.WriteLine(celebrate, holiday, day, year)
        
        ' Obtain the es-ES culture.
        Dim ci As New CultureInfo("es-ES")
        
        ' Get the resource strings for the day, year, and holiday 
        ' using the specified culture. Use those strings to 
        ' display a message. 
        ' Obtain resources using the es-ES culture.
        Console.WriteLine("Obtain resources using the es-ES culture.")
        
        day = rm.GetString("day", ci)
        year = rm.GetString("year", ci)
        holiday = rm.GetString("holiday", ci)
        
        ' ---------------------------------------------------------------
        ' Alternatively, comment the preceding 3 code statements and
 
        ' uncomment the following 4 code statements:
        ' ----------------------------------------------------------------
        ' Set the current UI culture to "es-ES" (Spanish-Spain).
        '    Thread.CurrentThread.CurrentUICulture = ci
        ' Get the resource strings for the day, year, and holiday 
        ' using the current UI culture. Use those strings to 
        ' display a message. 
        '    day  = rm.GetString("day")
        '    year = rm.GetString("year")
        '    holiday = rm.GetString("holiday")
        ' ---------------------------------------------------------------
        ' Regardless of the alternative that you choose, display a message
 
        ' using the retrieved resource strings.
        Console.WriteLine(celebrate, holiday, day, year)
    
    End Sub 'Main
End Class 'Sample

'
'This code example produces the following results:
'
'>rmc
'Obtain resources using the current UI culture.
'"5th of May" will occur on Friday in 2006.
'
'Obtain resources using the es-ES culture.
'"Cinco de Mayo" will occur on Viernes in 2006.
'
// This code example demonstrates the ResourceManager() 
// constructor and ResourceManager.GetString() method.

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

/*
Perform the following steps to use this code example:

Main assembly:
1) In a main directory, create a file named "rmc.txt" that 
contains the following resource strings:

day=Friday
year=2006
holiday="Cinco de Mayo"

2) Use the resgen.exe tool to generate the "rmc.resources" 
resource file from the "rmc.txt" input file.

> resgen rmc.txt

Satellite Assembly:
3) Create a subdirectory of the main directory and name the 
subdirectory "es-ES", which is the culture name of the 
satellite assembly.

4) Create a file named "rmc.es-ES.txt" that contains the 
following resource strings:

day=Viernes
year=2006
holiday="Cinco de Mayo"

5) Use the resgen.exe tool to generate the "rmc.es-ES.resources" 
resource file from the "rmc.es-ES.txt" input file.

> resgen rmc.es-ES.txt

6) Use the al.exe tool to create a satellite assembly. If the 
base name of the application is "rmc", the satellite
 assembly 
name must be "rmc.resources.dll". Also, specify the culture, 
which is es-ES.

> al /embed:rmc.es-ES.resources /c:es-ES /out:rmc.resources.dll 

7) Assume the filename for this code example
 is "rmc.cs". Compile 
rmc.cs and embed the main assembly resource file, rmc.resources, in
 
the executable assembly, rmc.exe:

>csc /res:rmc.resources rmc.cs

8) Execute rmc.exe, which obtains and displays the embedded 
resource strings.
*/

class Sample 
{
    public static void Main()
 
    {
    string day;
    string year;
    string holiday;
    string celebrate = "{0} will occur on {1} in
 {2}.\n";

// Create a resource manager. The GetExecutingAssembly() method
// gets rmc.exe as an Assembly object.

    ResourceManager rm = new ResourceManager("rmc",
 
                             Assembly.GetExecutingAssembly());

// Obtain resources using the current UI culture.
    Console.WriteLine("Obtain resources using the current
 UI culture.");

// Get the resource strings for the day, year, and holiday 
// using the current UI culture. Use those strings to 
// display a message.

    day  = rm.GetString("day");
    year = rm.GetString("year");
    holiday = rm.GetString("holiday");
    Console.WriteLine(celebrate, holiday, day, year);

// Obtain the es-ES culture.
    CultureInfo ci = new CultureInfo("es-ES");

// Get the resource strings for the day, year, and holiday 
// using the specified culture. Use those strings to 
// display a message. 

// Obtain resources using the es-ES culture.
    Console.WriteLine("Obtain resources using the es-ES culture.");

    day  = rm.GetString("day", ci);
    year = rm.GetString("year", ci);
    holiday = rm.GetString("holiday", ci);

// ---------------------------------------------------------------
// Alternatively, comment the preceding 3 code statements and 
// uncomment the following 4 code statements:
// ----------------------------------------------------------------

// Set the current UI culture to "es-ES" (Spanish-Spain).
//    Thread.CurrentThread.CurrentUICulture = ci;

// Get the resource strings for the day, year, and holiday 
// using the current UI culture. Use those strings to 
// display a message. 
//    day  = rm.GetString("day");
//    year = rm.GetString("year");
//    holiday = rm.GetString("holiday");
// ---------------------------------------------------------------

// Regardless of the alternative that you choose, display a message
 
// using the retrieved resource strings.
    Console.WriteLine(celebrate, holiday, day, year);
    }
}

/*
This code example produces the following results:

>rmc
Obtain resources using the current UI culture.
"5th of May" will occur on Friday in 2006.

Obtain resources using the es-ES culture.
"Cinco de Mayo" will occur on Viernes in 2006.

*/
継承階層継承階層
System.Object
  System.Resources.ResourceManager
     System.ComponentModel.ComponentResourceManager
スレッド セーフスレッド セーフ

この型は、マルチスレッド操作に対して安全です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ResourceManager コンストラクタ ()


ResourceManager コンストラクタ (Type)

指定した Type情報基づいてサテライト アセンブリリソース検索する ResourceManager作成します

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

Public Sub New ( _
    resourceSource As Type _
)
Dim resourceSource As Type

Dim instance As New ResourceManager(resourceSource)
public ResourceManager (
    Type resourceSource
)
public:
ResourceManager (
    Type^ resourceSource
)
public ResourceManager (
    Type resourceSource
)
public function ResourceManager (
    resourceSource : Type
)

パラメータ

resourceSource

ResourceManager が .resources ファイル検索するために必要な情報取得する元となる Type

例外例外
例外種類条件

ArgumentNullException

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

解説解説

ResourceManager は、.resources ファイルアセンブリ基本名、および名前空間Type から推論します。ResourceManager は、サテライト アセンブリ使用され既定の ResourceSet クラス使用されるものと仮定します。MyCompany.MyProduct.MyType のような型が指定されると、ResourceManager は、"MyCompany.MyProduct.MyType.[culture name.]resources" という (メイン アセンブリサテライト アセンブリの) .resources ファイルを、MyType が定義されているアセンブリで検索ます。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ResourceManager コンストラクタ (String, Assembly, Type)

指定したルート名から派生したファイル含まれているリソース検索する ResourceManager クラス新しインスタンスを、指定した Assembly使用して初期化します。

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

Public Sub New ( _
    baseName As String, _
    assembly As Assembly,
 _
    usingResourceSet As Type _
)
Dim baseName As String
Dim assembly As Assembly
Dim usingResourceSet As Type

Dim instance As New ResourceManager(baseName,
 assembly, usingResourceSet)
public ResourceManager (
    string baseName,
    Assembly assembly,
    Type usingResourceSet
)
public:
ResourceManager (
    String^ baseName, 
    Assembly^ assembly, 
    Type^ usingResourceSet
)
public ResourceManager (
    String baseName, 
    Assembly assembly, 
    Type usingResourceSet
)
public function ResourceManager (
    baseName : String, 
    assembly : Assembly, 
    usingResourceSet : Type
)

パラメータ

baseName

リソースルート名。たとえば、"MyResource.en-US.resources" というリソース ファイルルート名は "MyResource" です。

assembly

リソースメイン Assembly

usingResourceSet

使用するカスタム ResourceSet の Typenull 参照 (Visual Basic では Nothing) の場合は、既定ランタイム ResourceSet使用されます。

例外例外
例外種類条件

ArgumentException

usingResourcesetResourceSet派生クラスではありません。

ArgumentNullException

baseName パラメータまたは assembly パラメータnull 参照 (Visual Basic では Nothing) です。

解説解説

それぞれのリソース ファイルは、サテライト アセンブリ含める必要があります。インバリアント カルチャの .resources ファイルメイン アセンブリ含めます。サテライト アセンブリは、そのアセンブリマニフェスト指定されている単一カルチャのリソース含んでいるものと見なされ、必要に応じて読み込まれます。

使用する ResourceSet 実装指定できます特定の ResourceSet実装する必要がなくても、カスタム リソース ファイル形式使用する場合は、ResourceSet クラスから派生させ、GetDefaultReader と GetDefaultWriter をオーバーライドし、その型をこのコンストラクタ渡します

メモメモ

usingResourceSet パラメータ使用して、独自のリソース形式サポートします通常null 参照 (Visual Basic では Nothing) です。これは、Type だけをとるコンストラクタとは異なります

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ResourceManager コンストラクタ


ResourceManager コンストラクタ (String, Assembly)

指定したルート名から派生したファイル含まれているリソース検索する ResourceManager クラス新しインスタンスを、指定した Assembly使用して初期化します。

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

例外例外
例外種類条件

ArgumentNullException

baseName パラメータまたは assembly パラメータnull 参照 (Visual Basic では Nothing) です。

解説解説

それぞれのリソース ファイルは、サテライト アセンブリ含める必要があります。インバリアント カルチャの .resources ファイルメイン アセンブリ含めます。サテライト アセンブリは、そのアセンブリマニフェスト指定されている単一カルチャのリソース含んでいるものと見なされ、必要に応じて読み込まれます。

このコンストラクタは、システム提供の ResourceSet 実装使用しますカスタム リソース ファイル形式使用するには、ResourceSet クラスから派生させ、GetDefaultReader と GetDefaultWriter をオーバーライドし、3 番目のパラメータとして Type をとるコンストラクタにその型を渡しますカスタム ResourceSet使用すると、リソースキャッシュ ポリシー制御、または独自のリソース ファイル形式サポートのために役立つことがありますが、通常は必要ありません。

使用例使用例
Imports System
Imports System.Globalization
Imports System.Threading
Imports System.Resources
Imports System.Reflection

Class ResourcesExample
   
    Public Shared Sub Main()
        ' Create a resource manager to retrieve resources.
        Dim rm As New ResourceManager("items",
 _
           [Assembly].GetExecutingAssembly())
       
        ' Get the culture of the currently executing thread.
        ' The value of ci will determine the culture of
        ' the resources that the resource manager retrieves.
        Dim ci As CultureInfo = Thread.CurrentThread.CurrentCulture
      
        ' Retrieve the value of the string resource named 
        ' "welcome" localized for the culture specified by
 ci.
        Dim str As [String] = rm.GetString("welcome",
 ci)
        Console.WriteLine(str)
    End Sub
End Class
using System;
using System.Globalization;
using System.Threading;
using System.Resources;
using System.Reflection;

class ResourcesExample 
{
    public static void Main()
 
    {
       // Create a resource manager to retrieve resources.
       ResourceManager rm = new ResourceManager("items",
 
          Assembly.GetExecutingAssembly());

       // Get the culture of the currently executing thread.
       // The value of ci will determine the culture of
       // the resources that the resource manager retrieves.
       CultureInfo ci = Thread.CurrentThread.CurrentCulture;
        
       // Retrieve the value of the string resource named 
       // "welcome", localized for the culture specified by
 ci.
       String str = rm.GetString("welcome", ci);
       Console.WriteLine(str);
    }
}
using namespace System;
using namespace System::Globalization;
using namespace System::Threading;
using namespace System::Resources;
using namespace System::Reflection;
int main()
{
   
   // Create a resource manager to retrieve resources.
   ResourceManager^ rm = gcnew ResourceManager( "items",Assembly::GetExecutingAssembly()
 );
   
   // Get the culture of the currently executing thread.
   // The value of ci will determine the culture of
   // the resources that the resource manager retrieves.
   CultureInfo^ ci = Thread::CurrentThread->CurrentCulture;
   
   // Retrieve the value of the string resource named
   // S"welcome", localized for the culture specified by ci.
   String^ str = rm->GetString( "welcome", ci );
   Console::WriteLine( str );
}

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

class ResourcesExample
{

    public static void main(String[]
 args)
    {
        // Create a resource manager to retrieve resources.
        ResourceManager rm = new ResourceManager("items",
 
            Assembly.GetExecutingAssembly());

        // Get the culture of the currently executing thread.
        // The value of ci will determine the culture of
        // the resources that the resource manager retrieves.
        CultureInfo ci = 
            System.Threading.Thread.get_CurrentThread().get_CurrentCulture();

        // Retrieve the value of the string resource named 
        // "welcome", localized for the culture specified by
 ci.
        String str = rm.GetString("welcome", ci);
        Console.WriteLine(str);
    } //main
} //ResourcesExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ResourceManager フィールド


パブリック フィールドパブリック フィールド

プロテクト フィールドプロテクト フィールド
  名前 説明
プロテクト フィールド BaseNameField ResourceManager が、リソース検索するリソース ファイルルート名を示します
プロテクト フィールド MainAssembly リソースを含むメイン Assembly示します
プロテクト フィールド ResourceSets カルチャから ResourceSet オブジェクトへの割り当て返す Hashtable格納します
参照参照

関連項目

ResourceManager クラス
System.Resources 名前空間
CultureInfo
SatelliteContractVersionAttribute

その他の技術情報

エンコーディングローカリゼーション

ResourceManager プロパティ


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

( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ ResourceSetType ResourceManager が ResourceSet オブジェクト生成するために使用する ResourceSetType取得します
プロテクト プロパティプロテクト プロパティ
参照参照

関連項目

ResourceManager クラス
System.Resources 名前空間
CultureInfo
SatelliteContractVersionAttribute

その他の技術情報

エンコーディングローカリゼーション

ResourceManager メソッド


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

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド CreateFileBasedResourceManager アセンブリ マニフェストではなくリソース特定のディレクトリ検索する ResourceManager を返します
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetObject オーバーロードされます現在の設定に対して指定されている Object リソースの値を取得します
パブリック メソッド GetResourceSet 特定のカルチャに使用する ResourceSet を取得します
パブリック メソッド GetStream オーバーロードされます。 MemoryStream から UnmanagedMemoryStream を返します
パブリック メソッド GetString オーバーロードされます指定したカルチャまたは現在の暗黙UI カルチャの指定した String リソース取得します
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ReleaseAllResources すべての ResourceSet オブジェクトClose呼び出しすべてのリソース解放するように ResourceManager指示します
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 ( Object から継承されます。)
プロテクト メソッド GetNeutralResourcesLanguage 指定した Assembly で NeutralResourcesLanguageAttribute の値を読み取ってメイン アセンブリニュートラル リソースの CultureInfo を返します
プロテクト メソッド GetResourceFileName 指定した CultureInfoリソース ファイルの名前を生成します
プロテクト メソッド GetSatelliteContractVersion 指定したアセンブリの SatelliteContractVersionAttribute で指定されVersion返します
プロテクト メソッド InternalGetResourceSet ResourceSet検索実装ます。
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 ( Object から継承されます。)
参照参照

関連項目

ResourceManager クラス
System.Resources 名前空間
CultureInfo
SatelliteContractVersionAttribute

その他の技術情報

エンコーディングローカリゼーション

ResourceManager メンバ

カルチャ固有のリソースに、実行時簡単にアクセスできるようにします。

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


パブリック コンストラクタパブリック コンストラクタ
プロテクト コンストラクタプロテクト コンストラクタ
パブリック フィールドパブリック フィールド
プロテクト フィールドプロテクト フィールド
  名前 説明
プロテクト フィールド BaseNameField ResourceManager が、リソース検索するリソース ファイルルート名を示します
プロテクト フィールド MainAssembly リソースを含むメイン Assembly示します
プロテクト フィールド ResourceSets カルチャから ResourceSet オブジェクトへの割り当て返す Hashtable格納します
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ ResourceSetType ResourceManagerResourceSet オブジェクト生成するために使用する ResourceSetType取得します
プロテクト プロパティプロテクト プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド CreateFileBasedResourceManager アセンブリ マニフェストではなくリソース特定のディレクトリ検索する ResourceManager返します
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetObject オーバーロードされます現在の設定に対して指定されている Object リソースの値を取得します
パブリック メソッド GetResourceSet 特定のカルチャに使用する ResourceSet を取得します
パブリック メソッド GetStream オーバーロードされます。 MemoryStream から UnmanagedMemoryStream を返します
パブリック メソッド GetString オーバーロードされます指定したカルチャまたは現在の暗黙UI カルチャの指定した String リソース取得します
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ReleaseAllResources すべての ResourceSet オブジェクトClose呼び出しすべてのリソース解放するように ResourceManager指示します
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 (Object から継承されます。)
プロテクト メソッド GetNeutralResourcesLanguage 指定した Assembly で NeutralResourcesLanguageAttribute の値を読み取ってメイン アセンブリニュートラル リソースの CultureInfo を返します
プロテクト メソッド GetResourceFileName 指定した CultureInfoリソース ファイルの名前を生成します
プロテクト メソッド GetSatelliteContractVersion 指定したアセンブリの SatelliteContractVersionAttribute で指定されVersion返します
プロテクト メソッド InternalGetResourceSet ResourceSet検索実装ます。
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 (Object から継承されます。)
参照参照

関連項目

ResourceManager クラス
System.Resources 名前空間
CultureInfo
SatelliteContractVersionAttribute

その他の技術情報

エンコーディングローカリゼーション



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

辞書ショートカット

すべての辞書の索引

「ResourceManager」の関連用語











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

   

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



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

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

©2025 GRAS Group, Inc.RSS