Search Results for

    Class ResourceErrorMessageSource

    Reads error messages from .resx files: resource name = Code. The neutral file (Errors.resx) holds English; each language adds its own (Errors.ar.resx, Errors.fr.resx).

    Inheritance
    object
    ResourceErrorMessageSource
    Implements
    IErrorMessageSource
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ZhEaIsNsAaBn.Utilities
    Assembly: ZhEaIsNsAaBn.LayerResponse.dll
    Syntax
    public sealed class ResourceErrorMessageSource : IErrorMessageSource
    Examples
    var source = new ResourceErrorMessageSource( AppErrors.ResourceManager );   // AppErrors = the .resx designer class

    Constructors

    ResourceErrorMessageSource(ResourceManager)

    Creates the source.

    Declaration
    public ResourceErrorMessageSource(ResourceManager resourceManager)
    Parameters
    Type Name Description
    ResourceManager resourceManager

    The resources, e.g. the ResourceManager of a .resx designer class.

    Exceptions
    Type Condition
    ArgumentNullException

    resourceManager is null.

    Methods

    Find(string, CultureInfo)

    The message for code in exactly culture — no fallback to parent cultures.

    Declaration
    public string? Find(string code, CultureInfo culture)
    Parameters
    Type Name Description
    string code

    The error code, e.g. NotFound.

    CultureInfo culture

    The culture; InvariantCulture asks for the neutral (English) text.

    Returns
    Type Description
    string

    The message template, or null when this source has none for that culture.

    Exceptions
    Type Condition
    ArgumentNullException

    code or culture is null.

    Implements

    IErrorMessageSource
    In this article
    Back to top Generated by DocFX