StronglyTypedResourceBuilder::Create Method (IDictionary^, String^, String^, String^, CodeDomProvider^, Boolean, array<String^>^%)
Generates a class file that contains strongly typed properties that match the resources referenced in the specified collection.
Assembly: System.Design (in System.Design.dll)
public: static CodeCompileUnit^ Create( IDictionary^ resourceList, String^ baseName, String^ generatedCodeNamespace, String^ resourcesNamespace, CodeDomProvider^ codeProvider, bool internalClass, [OutAttribute] array<String^>^% unmatchable )
Parameters
- resourceList
-
Type:
System.Collections::IDictionary^
An IDictionary collection where each dictionary entry key/value pair is the name of a resource and the value of the resource.
- baseName
-
Type:
System::String^
The name of the class to be generated.
- generatedCodeNamespace
-
Type:
System::String^
The namespace of the class to be generated.
- resourcesNamespace
-
Type:
System::String^
The namespace of the resource to be generated.
- codeProvider
-
Type:
System.CodeDom.Compiler::CodeDomProvider^
A CodeDomProvider object that provides the language in which the class will be generated.
- internalClass
-
Type:
System::Boolean
true to generate an internal class; false to generate a public class.
- unmatchable
-
Type:
array<System::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.
| Exception | Condition |
|---|---|
| ArgumentNullException | resourceList, basename, or codeProvider is null. |
| ArgumentException | A resource node name does not match its key in resourceList. |
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.
Available since 2.0