Struct LookupFailure

Namespace
RentADeveloper.ResXLocalization
Assembly
ResXLocalization.Core.dll

Describes a failed lookup. LookupFailed reports it, and LookupFailureTextBuilder receives it to produce the failure text.

public readonly record struct LookupFailure : IEquatable<LookupFailure>
Implements
Inherited Members

Constructors

LookupFailure(LookupFailureReason, string, CultureInfo, ResourceManager?, MessageArguments, string?, Exception?)

Describes a failed lookup. LookupFailed reports it, and LookupFailureTextBuilder receives it to produce the failure text.

public LookupFailure(LookupFailureReason Reason, string Key, CultureInfo Culture, ResourceManager? ResourceManager, MessageArguments Arguments, string? Pattern, Exception? Exception)

Parameters

Reason LookupFailureReason

Why the lookup failed: TranslationNotFound or MessageFormatFailed.

Key string

The key as looked up, including an enum lookup's full convention key (for example Enum_FileSortOrder_Ascending); never null or empty.

Culture CultureInfo

The culture of the lookup - the CurrentCulture read once at its start; never null.

ResourceManager ResourceManager

The resource manager of a scoped or typed lookup (for a typed lookup, Manager); null for a search-all lookup.

Arguments MessageArguments

The arguments of the lookup; never null, empty when the lookup had none.

Pattern string

For MessageFormatFailed, the resolved resource value that failed to format; for TranslationNotFound, null.

Exception Exception

For MessageFormatFailed, what the formatter threw; for TranslationNotFound, null.

Properties

Arguments

The arguments of the lookup; never null, empty when the lookup had none.

public MessageArguments Arguments { get; init; }

Property Value

MessageArguments

Culture

The culture of the lookup - the CurrentCulture read once at its start; never null.

public CultureInfo Culture { get; init; }

Property Value

CultureInfo

Exception

For MessageFormatFailed, what the formatter threw; for TranslationNotFound, null.

public Exception? Exception { get; init; }

Property Value

Exception

Key

The key as looked up, including an enum lookup's full convention key (for example Enum_FileSortOrder_Ascending); never null or empty.

public string Key { get; init; }

Property Value

string

Pattern

For MessageFormatFailed, the resolved resource value that failed to format; for TranslationNotFound, null.

public string? Pattern { get; init; }

Property Value

string

Reason

Why the lookup failed: TranslationNotFound or MessageFormatFailed.

public LookupFailureReason Reason { get; init; }

Property Value

LookupFailureReason

ResourceManager

The resource manager of a scoped or typed lookup (for a typed lookup, Manager); null for a search-all lookup.

public ResourceManager? ResourceManager { get; init; }

Property Value

ResourceManager