C# Класс Lucene.Net.Support.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.
Наследование: IResourceManagerFactory
Показать файл Открыть проект

Открытые методы

Метод Описание
Create ( Type resourceSource ) : ResourceManager

Creates a ResourceManager instance using the specified resourceSource.

Release ( ResourceManager manager ) : void

Releases the ResourceManager instance including any disposable dependencies.

Защищенные методы

Метод Описание
GetResourceType ( Type clazz ) : Type

Converts the Java NLS type to the .NET resource type. In Java, these were one and the same, but in .NET it is not possible to create resources in Visual Studio with the same class name as a resource class because the resource generation process already creates a backing class with the same name as the resource. So, by convention the resources must be named <messages class name> + ResourceSuffix (default value "Bundle") in order to be found by NLS.

Описание методов

Create() публичный Метод

Creates a ResourceManager instance using the specified resourceSource.
public Create ( Type resourceSource ) : ResourceManager
resourceSource System.Type The type representing the resource to retrieve.
Результат System.Resources.ResourceManager

GetResourceType() защищенный Метод

Converts the Java NLS type to the .NET resource type. In Java, these were one and the same, but in .NET it is not possible to create resources in Visual Studio with the same class name as a resource class because the resource generation process already creates a backing class with the same name as the resource. So, by convention the resources must be named <messages class name> + ResourceSuffix (default value "Bundle") in order to be found by NLS.
protected GetResourceType ( Type clazz ) : Type
clazz System.Type The type of the NLS class where the field strings are located that identify resources.
Результат System.Type

Release() публичный Метод

Releases the ResourceManager instance including any disposable dependencies.
public Release ( ResourceManager manager ) : void
manager System.Resources.ResourceManager The to release.
Результат void