StronglyTypedResourceBuilder.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Generates a class file that contains strongly typed properties that match the resources that are specified in the input parameter.
Overloads
Create(IDictionary, String, String, CodeDomProvider, Boolean, String[]) |
Generates a class file that contains strongly typed properties that match the resources referenced in the specified collection. |
Create(String, String, String, CodeDomProvider, Boolean, String[]) |
Generates a class file that contains strongly typed properties that match the resources in the specified .resx file. |
Create(IDictionary, String, String, String, CodeDomProvider, Boolean, String[]) |
Generates a class file that contains strongly typed properties that match the resources referenced in the specified collection. |
Create(String, String, String, String, CodeDomProvider, Boolean, String[]) |
Generates a class file that contains strongly typed properties that match the resources in the specified .resx file. |
Create(IDictionary, String, String, CodeDomProvider, Boolean, String[])
Generates a class file that contains strongly typed properties that match the resources referenced in the specified collection.
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
Parameters
- resourceList
- IDictionary
An IDictionary collection where each dictionary entry key/value pair is the name of a resource and the value of the resource.
- baseName
- String
The name of the class to be generated.
- generatedCodeNamespace
- String
The namespace of the class to be generated.
- codeProvider
- CodeDomProvider
A CodeDomProvider class that provides the language in which the class will be generated.
- internalClass
- Boolean
true
to generate an internal class; false
to generate a public class.
- unmatchable
- String[]
An array that contains each resource name for which a property cannot be generated. Typically, a property cannot be generated because the resource name is not a valid identifier.
Returns
A CodeCompileUnit container.
Exceptions
resourceList
, basename
, or codeProvider
is null
.
A resource node name does not match its key in resourceList
.
Remarks
Use the Create method to generate a class that provides a strongly typed, read-only wrapper to access the resources that are contained in the resourceList
parameter.
The StronglyTypedResourceBuilder class ignores any resource name that begins with the characters "$" or ">>". The resource names "Culture" and "ResourceManager" are invalid identifiers.
Applies to
Create(String, String, String, CodeDomProvider, Boolean, String[])
Generates a class file that contains strongly typed properties that match the resources in the specified .resx file.
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
Parameters
- resxFile
- String
The name of a .resx file used as input.
- baseName
- String
The name of the class to be generated.
- generatedCodeNamespace
- String
The namespace of the class to be generated.
- codeProvider
- CodeDomProvider
A CodeDomProvider class that provides the language in which the class will be generated.
- internalClass
- Boolean
true
to generate an internal class; false
to generate a public class.
- unmatchable
- String[]
A String array that contains each resource name for which a property cannot be generated. Typically, a property cannot be generated because the resource name is not a valid identifier.
Returns
A CodeCompileUnit container.
Exceptions
basename
or codeProvider
is null
.
Remarks
Use the Create method to generate a class that provides strongly typed, read-only access to the resources that are contained in the resxFile
parameter.
The StronglyTypedResourceBuilder class ignores any resource name that begins with the characters "$" or ">>". The resource names "Culture" and "ResourceManager" are invalid identifiers.
Applies to
Create(IDictionary, String, String, String, CodeDomProvider, Boolean, String[])
Generates a class file that contains strongly typed properties that match the resources referenced in the specified collection.
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
Parameters
- resourceList
- IDictionary
An IDictionary collection where each dictionary entry key/value pair is the name of a resource and the value of the resource.
- baseName
- String
The name of the class to be generated.
- generatedCodeNamespace
- String
The namespace of the class to be generated.
- resourcesNamespace
- String
The namespace of the resource to be generated.
- codeProvider
- CodeDomProvider
A CodeDomProvider object that provides the language in which the class will be generated.
- internalClass
- Boolean
true
to generate an internal class; false
to generate a public class.
- unmatchable
- String[]
A String array that contains each resource name for which a property cannot be generated. Typically, a property cannot be generated because the resource name is not a valid identifier.
Returns
A CodeCompileUnit container.
Exceptions
resourceList
, basename
, or codeProvider
is null
.
A resource node name does not match its key in resourceList
.
Remarks
This overload enables you to use the resourcesNamespace
parameter to specify the namespace for the generated resources. In this case, the generated code appears as follows:
System.Resources.ResourceManager rm = new System.Resources.ResourceManager("<resourceNamespace>.<baseName>",typeof(baseName).Assembly);
In most cases, you do not need to call this method from your application code.
The StronglyTypedResourceBuilder class ignores any resource name that begins with the characters "$" or ">>". The resource names "Culture" and "ResourceManager" are invalid identifiers.
Applies to
Create(String, String, String, String, CodeDomProvider, Boolean, String[])
Generates a class file that contains strongly typed properties that match the resources in the specified .resx file.
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
Parameters
- resxFile
- String
The name of a .resx file used as input.
- baseName
- String
The name of the class to be generated.
- generatedCodeNamespace
- String
The namespace of the class to be generated.
- resourcesNamespace
- String
The namespace of the resource to be generated.
- codeProvider
- CodeDomProvider
A CodeDomProvider class that provides the language in which the class will be generated.
- internalClass
- Boolean
true
to generate an internal class; false
to generate a public class.
- unmatchable
- String[]
A String array that contains each resource name for which a property cannot be generated. Typically, a property cannot be generated because the resource name is not a valid identifier.
Returns
A CodeCompileUnit container.
Exceptions
basename
or codeProvider
is null
.
Remarks
Use the Create method to generate a class that provides strongly typed, read-only access to the resources that are contained in the resxFile
parameter.
The StronglyTypedResourceBuilder class ignores any resource name that begins with the characters "$" or ">>". The resource names "Culture" and "ResourceManager" are invalid identifiers.