Class BundleResourceManagerFactory
This implementation of IResourceManagerFactory uses a convention
to retrieve resources. In Java NLS, the convention is to use the same name for the
resource key propeties and for the resource file names. This presents a problem
for .NET because the resource generator already creates an internal class with the
same name as the .resx file.
To work around this, we use the convention of appending the suffix "Bundle" to
the end of the type the resource key propeties are stored in. For example,
if our constants are stored in a class named ErrorMessages, the type
that will be looked up by this factory will be ErrorMessagesBundle (which is the
name of the .resx file that should be added to your project).
This implementation can be inherited to use a different convention or can be replaced to get the resources from an external source.
Inheritance
Implements
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public class BundleResourceManagerFactory : object, IResourceManagerFactory
Properties
| Improve this Doc View SourceResourceSuffix
The suffix to append to the resource key class name to locate the embedded resource.
Declaration
protected virtual string ResourceSuffix { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceCreate(Type)
Creates a resourceSource.
Declaration
public virtual ResourceManager Create(Type resourceSource)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | resourceSource | The type representing the resource to retrieve. |
Returns
| Type | Description |
|---|---|
| ResourceManager | A new |
GetResourceName(Type)
Gets the fully-qualified name of the bundle as it would appear
using .resources extension. This is the name that is passed to the
baseName parameter of
Declaration
protected virtual string GetResourceName(Type clazz)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | clazz | The type of the NLS-derived class where the field strings are located that identify resources. |
Returns
| Type | Description |
|---|---|
| System.String | The resource name. |
Release(ResourceManager)
Releases the
Declaration
public virtual void Release(ResourceManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| ResourceManager | manager | The |