StronglyTypedResourceBuilder.Create Method (String, String, String, CodeDomProvider, Boolean, String[])

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Generates a class file that contains strongly typed properties that match the resources in the specified .resx file.

Namespace:   System.Resources.Tools
Assembly:  System.Design (in System.Design.dll)

public static CodeCompileUnit Create(
	string resxFile,
	string baseName,
	string generatedCodeNamespace,
	CodeDomProvider codeProvider,
	bool internalClass,
	out string[] unmatchable
)

Parameters

resxFile
Type: System.String

The name of a .resx file used as input.

baseName
Type: System.String

The name of the class to be generated.

generatedCodeNamespace
Type: System.String

The namespace of the class to be generated.

codeProvider
Type: System.CodeDom.Compiler.CodeDomProvider

A CodeDomProvider class 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: 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.

Return Value

Type: System.CodeDom.CodeCompileUnit

A CodeCompileUnit container.

Exception Condition
ArgumentNullException

basename or codeProvider is null.

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.

.NET Framework
Available since 2.0
Return to top
Show: