Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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

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

Namespace:  System.Resources.Tools
Assembly:  System.Design (in System.Design.dll)
public static CodeCompileUnit Create(
	IDictionary resourceList,
	string baseName,
	string generatedCodeNamespace,
	CodeDomProvider codeProvider,
	bool internalClass,
	out 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.

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[]

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.

Return Value

Type: System.CodeDom.CodeCompileUnit
A CodeCompileUnit container.
ExceptionCondition
ArgumentNullException

resourceList, basename, or codeProvider is null.

ArgumentException

A resource node name does not match its key in resourceList.

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.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.