Show / Hide Table of Contents

    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
    System.Object
    BundleResourceManagerFactory
    Implements
    IResourceManagerFactory
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public class BundleResourceManagerFactory : object, IResourceManagerFactory

    Properties

    | Improve this Doc View Source

    ResourceSuffix

    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 Source

    Create(Type)

    Creates a instance using the specified 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 instance.

    | Improve this Doc View Source

    GetResourceName(Type)

    Gets the fully-qualified name of the bundle as it would appear using , without the .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.

    | Improve this Doc View Source

    Release(ResourceManager)

    Releases the instance including any disposable dependencies.

    Declaration
    public virtual void Release(ResourceManager manager)
    Parameters
    Type Name Description
    ResourceManager manager

    The to release.

    Implements

    IResourceManagerFactory
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)