StronglyTypedResourceBuilder.Create 方法

定义

生成一个类文件,该文件包含与输入参数中所指定的资源相匹配的强类型属性。

重载

Create(IDictionary, String, String, CodeDomProvider, Boolean, String[])

生成一个类文件,该文件包含与指定集合中引用的资源相匹配的强类型的属性。

Create(String, String, String, CodeDomProvider, Boolean, String[])

生成一个类文件,该文件包含与指定的 .resx 文件中的资源相匹配的强类型属性。

Create(IDictionary, String, String, String, CodeDomProvider, Boolean, String[])

生成一个类文件,该文件包含与指定集合中引用的资源相匹配的强类型的属性。

Create(String, String, String, String, CodeDomProvider, Boolean, String[])

生成一个类文件,该文件包含与指定的 .resx 文件中的资源相匹配的强类型属性。

Create(IDictionary, String, String, CodeDomProvider, Boolean, String[])

生成一个类文件,该文件包含与指定集合中引用的资源相匹配的强类型的属性。

public:
 static System::CodeDom::CodeCompileUnit ^ Create(System::Collections::IDictionary ^ resourceList, System::String ^ baseName, System::String ^ generatedCodeNamespace, System::CodeDom::Compiler::CodeDomProvider ^ codeProvider, bool internalClass, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % unmatchable);
public static System.CodeDom.CodeCompileUnit Create (System.Collections.IDictionary resourceList, string baseName, string generatedCodeNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[] unmatchable);
public static System.CodeDom.CodeCompileUnit Create (System.Collections.IDictionary resourceList, string baseName, string? generatedCodeNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[]? unmatchable);
static member Create : System.Collections.IDictionary * string * string * System.CodeDom.Compiler.CodeDomProvider * bool * String[] -> System.CodeDom.CodeCompileUnit
Public Shared Function Create (resourceList As IDictionary, baseName As String, generatedCodeNamespace As String, codeProvider As CodeDomProvider, internalClass As Boolean, ByRef unmatchable As String()) As CodeCompileUnit

参数

resourceList
IDictionary

一个 IDictionary 集合,其中每个字典条目键值对都是资源的名称以及资源的值。

baseName
String

要生成的类的名称。

generatedCodeNamespace
String

要生成的类的命名空间。

codeProvider
CodeDomProvider

一个 CodeDomProvider 类,该类提供生成该类所使用的语言。

internalClass
Boolean

如果生成内部类,则为 true;如果生成公共类,则为 false

unmatchable
String[]

一个数组,该数组包含无法为其生成属性的每个资源名称。 通常,无法生成属性是因为该资源名称不是有效的标识符。

返回

一个 CodeCompileUnit 容器。

例外

resourceListbasenamecodeProvidernull

资源节点名称与其在 resourceList 中的键不匹配。

注解

Create使用 方法生成一个类,该类提供强类型只读包装器来访问 参数中包含的resourceList资源。

StronglyTypedResourceBuilder 忽略以字符“$”或“”>>开头的任何资源名称。 资源名称“Culture”和“ResourceManager”是无效的标识符。

适用于

Create(String, String, String, CodeDomProvider, Boolean, String[])

生成一个类文件,该文件包含与指定的 .resx 文件中的资源相匹配的强类型属性。

public:
 static System::CodeDom::CodeCompileUnit ^ Create(System::String ^ resxFile, System::String ^ baseName, System::String ^ generatedCodeNamespace, System::CodeDom::Compiler::CodeDomProvider ^ codeProvider, bool internalClass, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % unmatchable);
public static System.CodeDom.CodeCompileUnit Create (string resxFile, string baseName, string generatedCodeNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[] unmatchable);
public static System.CodeDom.CodeCompileUnit Create (string resxFile, string baseName, string? generatedCodeNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[]? unmatchable);
static member Create : string * string * string * System.CodeDom.Compiler.CodeDomProvider * bool * String[] -> System.CodeDom.CodeCompileUnit
Public Shared Function Create (resxFile As String, baseName As String, generatedCodeNamespace As String, codeProvider As CodeDomProvider, internalClass As Boolean, ByRef unmatchable As String()) As CodeCompileUnit

参数

resxFile
String

.resx 文件的名称用作输入。

baseName
String

要生成的类的名称。

generatedCodeNamespace
String

要生成的类的命名空间。

codeProvider
CodeDomProvider

一个 CodeDomProvider 类,该类提供生成该类所使用的语言。

internalClass
Boolean

如果生成内部类,则为 true;如果生成公共类,则为 false

unmatchable
String[]

一个 String 数组,该数组包含无法为其生成属性的每个资源名称。 通常,无法生成属性是因为该资源名称不是有效的标识符。

返回

一个 CodeCompileUnit 容器。

例外

basenamecodeProvidernull

注解

Create使用 方法生成一个类,该类提供对 参数中包含的resxFile资源的强类型只读访问权限。

StronglyTypedResourceBuilder 忽略以字符“$”或“”>>开头的任何资源名称。 资源名称“Culture”和“ResourceManager”是无效的标识符。

适用于

Create(IDictionary, String, String, String, CodeDomProvider, Boolean, String[])

生成一个类文件,该文件包含与指定集合中引用的资源相匹配的强类型的属性。

public:
 static System::CodeDom::CodeCompileUnit ^ Create(System::Collections::IDictionary ^ resourceList, System::String ^ baseName, System::String ^ generatedCodeNamespace, System::String ^ resourcesNamespace, System::CodeDom::Compiler::CodeDomProvider ^ codeProvider, bool internalClass, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % unmatchable);
public static System.CodeDom.CodeCompileUnit Create (System.Collections.IDictionary resourceList, string baseName, string generatedCodeNamespace, string resourcesNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[] unmatchable);
public static System.CodeDom.CodeCompileUnit Create (System.Collections.IDictionary resourceList, string baseName, string? generatedCodeNamespace, string? resourcesNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[]? unmatchable);
static member Create : System.Collections.IDictionary * string * string * string * System.CodeDom.Compiler.CodeDomProvider * bool * String[] -> System.CodeDom.CodeCompileUnit
Public Shared Function Create (resourceList As IDictionary, baseName As String, generatedCodeNamespace As String, resourcesNamespace As String, codeProvider As CodeDomProvider, internalClass As Boolean, ByRef unmatchable As String()) As CodeCompileUnit

参数

resourceList
IDictionary

一个 IDictionary 集合,其中每个字典条目键值对都是资源的名称以及资源的值。

baseName
String

要生成的类的名称。

generatedCodeNamespace
String

要生成的类的命名空间。

resourcesNamespace
String

要生成的资源的命名空间。

codeProvider
CodeDomProvider

一个 CodeDomProvider 对象,该对象提供生成类所使用的语言。

internalClass
Boolean

如果生成内部类,则为 true;如果生成公共类,则为 false

unmatchable
String[]

一个 String 数组,该数组包含无法为其生成属性的每个资源名称。 通常,无法生成属性是因为该资源名称不是有效的标识符。

返回

一个 CodeCompileUnit 容器。

例外

resourceListbasenamecodeProvidernull

资源节点名称与其在 resourceList 中的键不匹配。

注解

此重载使你能够使用 resourcesNamespace 参数为生成的资源指定命名空间。 在这种情况下,生成的代码如下所示:

System.Resources.ResourceManager rm = new System.Resources.ResourceManager("<resourceNamespace>.<baseName>",typeof(baseName).Assembly);

在大多数情况下,无需从应用程序代码调用此方法。

StronglyTypedResourceBuilder 忽略以字符“$”或“”>>开头的任何资源名称。 资源名称“Culture”和“ResourceManager”是无效的标识符。

适用于

Create(String, String, String, String, CodeDomProvider, Boolean, String[])

生成一个类文件,该文件包含与指定的 .resx 文件中的资源相匹配的强类型属性。

public:
 static System::CodeDom::CodeCompileUnit ^ Create(System::String ^ resxFile, System::String ^ baseName, System::String ^ generatedCodeNamespace, System::String ^ resourcesNamespace, System::CodeDom::Compiler::CodeDomProvider ^ codeProvider, bool internalClass, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % unmatchable);
public static System.CodeDom.CodeCompileUnit Create (string resxFile, string baseName, string generatedCodeNamespace, string resourcesNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[] unmatchable);
public static System.CodeDom.CodeCompileUnit Create (string resxFile, string baseName, string? generatedCodeNamespace, string? resourcesNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[]? unmatchable);
static member Create : string * string * string * string * System.CodeDom.Compiler.CodeDomProvider * bool * String[] -> System.CodeDom.CodeCompileUnit
Public Shared Function Create (resxFile As String, baseName As String, generatedCodeNamespace As String, resourcesNamespace As String, codeProvider As CodeDomProvider, internalClass As Boolean, ByRef unmatchable As String()) As CodeCompileUnit

参数

resxFile
String

.resx 文件的名称用作输入。

baseName
String

要生成的类的名称。

generatedCodeNamespace
String

要生成的类的命名空间。

resourcesNamespace
String

要生成的资源的命名空间。

codeProvider
CodeDomProvider

一个 CodeDomProvider 类,该类提供生成该类所使用的语言。

internalClass
Boolean

如果生成内部类,则为 true;如果生成公共类,则为 false

unmatchable
String[]

一个 String 数组,该数组包含无法为其生成属性的每个资源名称。 通常,无法生成属性是因为该资源名称不是有效的标识符。

返回

一个 CodeCompileUnit 容器。

例外

basenamecodeProvidernull

注解

Create使用 方法生成一个类,该类提供对 参数中包含的resxFile资源的强类型只读访问权限。

StronglyTypedResourceBuilder 忽略以字符“$”或“”>>开头的任何资源名称。 资源名称“Culture”和“ResourceManager”是无效的标识符。

适用于