Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Interface IResourceProvider

    Contract for a set of localized resources. Generally, this is an abstraction over one or more System.Resources.ResourceManager instances.

    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public interface IResourceProvider

    Methods

    | Improve this Doc View Source

    GetObject(String, CultureInfo)

    Gets the value of the specified non-string resource localized for the specified culture.

    Declaration
    object GetObject(string name, CultureInfo culture)
    Parameters
    Type Name Description
    System.String name

    The name of the resource to get.

    System.Globalization.CultureInfo culture

    The culture for which the resource is localized. If the resource is not localized for this culture, the resource manager uses fallback rules to locate an appropriate resource.

    If this value is null, the System.Globalization.CultureInfo object is obtained by using the System.Globalization.CultureInfo.CurrentUICulture property.

    Returns
    Type Description
    System.Object

    The value of the resource, localized for the specified culture. If an appropriate resource set exists but name cannot be found, the method returns null.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The name parameter is null.

    System.Resources.MissingManifestResourceException

    No usable set of resources has been found, and there are no resources for a default culture. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the System.Resources.ResourceManager class topic.

    System.Resources.MissingSatelliteAssemblyException

    The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the System.Resources.ResourceManager class topic.

    | Improve this Doc View Source

    GetStream(String, CultureInfo)

    Returns an unmanaged memory stream object from the specified resource, using the specified culture.

    Declaration
    Stream GetStream(string name, CultureInfo culture)
    Parameters
    Type Name Description
    System.String name

    The name of a resource.

    System.Globalization.CultureInfo culture

    An object that specifies the culture to use for the resource lookup. If culture is null, the culture for the current thread is used.

    Returns
    Type Description
    System.IO.Stream

    An unmanaged memory stream object that represents a resource.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The name parameter is null.

    System.InvalidOperationException

    The value of the specified resource is not a System.IO.MemoryStream object.

    System.Resources.MissingManifestResourceException

    No usable set of resources has been found, and there are no resources for a default culture. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the System.Resources.ResourceManager class topic.

    System.Resources.MissingSatelliteAssemblyException

    The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the System.Resources.ResourceManager class topic.

    | Improve this Doc View Source

    GetString(String, CultureInfo)

    Returns the value of the string resource localized for the specified culture.

    Declaration
    string GetString(string name, CultureInfo culture)
    Parameters
    Type Name Description
    System.String name

    The name of the resource to retrieve.

    System.Globalization.CultureInfo culture

    An object that represents the culture for which the resource is localized.

    Returns
    Type Description
    System.String

    The value of the resource localized for the specified culture, or null if name cannot be found in a resource set.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The name parameter is null.

    System.InvalidOperationException

    The value of the specified resource is not a string.

    System.Resources.MissingManifestResourceException

    No usable set of resources has been found, and there are no resources for a default culture. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the System.Resources.ResourceManager class topic.

    System.Resources.MissingSatelliteAssemblyException

    The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the System.Resources.ResourceManager class topic.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.