次の方法で共有


VCManagedResourceCompilerTool.ResourceFileName プロパティ

このツールによって生成される .resources 中間ファイルの名前を取得または設定します。

名前空間 :  Microsoft.VisualStudio.VCProjectEngine
アセンブリ :  Microsoft.VisualStudio.VCProjectEngine (Microsoft.VisualStudio.VCProjectEngine.dll 内)

構文

'宣言
Property ResourceFileName As String
'使用
Dim instance As VCManagedResourceCompilerTool
Dim value As String

value = instance.ResourceFileName

instance.ResourceFileName = value
string ResourceFileName { get; set; }
property String^ ResourceFileName {
    String^ get ();
    void set (String^ value);
}
function get ResourceFileName () : String
function set ResourceFileName (value : String)

プロパティ値

型 : System.String

生成される .resources 中間ファイルの名前を返します。

解説

デザイナでは、ResourceFileName の値を、<RootNamespace>.<ClassName>.Resources の形式で表す必要があります。<RootNamespace> はプロジェクトのルート名前空間、<ClassName> は関連付けられたフォーム ファイル内のクラス名です。リソースをローカライズする場合は、ロケールも名前の一部として含める必要があります。たとえば、フランス語のリソースでは、<RootNamespace>.<ClassName>.fr.resources という書式になります。

このサンプル コードをコンパイルして実行する方法については、「方法 : プロジェクト モデル機能拡張のプログラム例をコンパイルする」を参照してください。

' Add a reference to Microsoft.VisualStudio.VCProjectEngine and have a 
' Visual C++ project loaded before running this example.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim cfgs, tools As IVCCollection
        Dim cfg As VCFileConfiguration
        Dim tool As VCManagedResourceCompilerTool
        Dim file As VCFile
        prj = DTE.Solution.Projects.Item(1).Object
        file = prj.Files("Form1.resx")
        cfgs = file.FileConfigurations
        cfg = cfgs.Item(1)
        tool = cfg.Tool
        MsgBox("Resource file name: " & tool.ResourceFileName)
    End Sub
End Module

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

VCManagedResourceCompilerTool インターフェイス

VCManagedResourceCompilerTool メンバ

Microsoft.VisualStudio.VCProjectEngine 名前空間