NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ResourceManager Constructor (String, Type, Type, Boolean)

Creates a ResourceManager for looking up resources beginning with the specified root name using the manifest of a specified type's Assembly.

[Visual Basic]
Overloads Public Sub New( _
   ByVal baseName As String, _
   ByVal locationInfo As Type, _
   ByVal usingResourceSet As Type, _
   ByVal usingSatelliteAssemblies As Boolean _
)
[C#]
public ResourceManager(
   string baseName,
   Type locationInfo,
   Type usingResourceSet,
   bool usingSatelliteAssemblies
);
[C++]
public: ResourceManager(
   String* baseName,
   Type* locationInfo,
   Type* usingResourceSet,
   bool usingSatelliteAssemblies
);
[JScript]
public function ResourceManager(
   baseName : String,
   locationInfo : Type,
   usingResourceSet : Type,
   usingSatelliteAssemblies : Boolean
);

Parameters

baseName
The root name of the resources. For example, the root name for the resource "MyResource.en-us.resources" is "MyResource".
locationInfo
The resources will be searched for in the Assembly of the Type locationInfo. Additionally, the namespace of locationInfo will be used to qualify resource names. For example, if the name of the Type locationInfo is "MyNamespace.MyType" and baseName is "MyResource", the ResourceManager will look for neutral resources named "MyNamespace.MyResource.resources" and for a German resource named "MyNamespace.MyResource.de.resources".
usingResourceSet
The Type of the custom ResourceSet to be used. If a null reference (in Visual Basic Nothing), the default runtime ResourceSet will be used.
usingSatelliteAssemblies
true if the ResourceManager should search for resources in satellite assemblies.

Exceptions

Exception Type Condition
ArgumentException if usingResourceSet is not a subclass of ResourceSet.
ArgumentNullException if baseName is a null reference (Nothing) or locationInfo is a null reference (Nothing).
MissingManifestResourceException if the assembly does not contain the resources for the neutral culture.

Remarks

The resources are searched for in a namespace qualified by a specified Type. On large projects, this will reduce collisions in resource names.

The individual resources can either all be contained in the specified main assembly, or they can be contained in satellite assemblies. A satellite assembly is assumed to contain resources for a single culture specified in that assembly's metadata. The satellite assemblies are loaded if necessary.

You can specify a ResourceSet implementation to be used. If you do not need a specific ResourceSet implementation but would like to use a custom resource file format, you should subclass ResourceSet, override GetDefaultReader and GetDefaultWriter, and pass that type to this constructor.

See Also

ResourceManager Class | ResourceManager Members | System.Resources Namespace | ResourceManager Constructor Overload List