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
ReasonLookupFailureReasonWhy the lookup failed: TranslationNotFound or MessageFormatFailed.
KeystringThe key as looked up, including an enum lookup's full convention key (for example
Enum_FileSortOrder_Ascending); never null or empty.CultureCultureInfoThe culture of the lookup - the CurrentCulture read once at its start; never null.
ResourceManagerResourceManagerThe resource manager of a scoped or typed lookup (for a typed lookup, Manager); null for a search-all lookup.
ArgumentsMessageArgumentsThe arguments of the lookup; never null, empty when the lookup had none.
PatternstringFor MessageFormatFailed, the resolved resource value that failed to format; for TranslationNotFound, null.
ExceptionExceptionFor 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
Culture
The culture of the lookup - the CurrentCulture read once at its start; never null.
public CultureInfo Culture { get; init; }
Property Value
Exception
For MessageFormatFailed, what the formatter threw; for TranslationNotFound, null.
public Exception? Exception { get; init; }
Property Value
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
Pattern
For MessageFormatFailed, the resolved resource value that failed to format; for TranslationNotFound, null.
public string? Pattern { get; init; }
Property Value
Reason
Why the lookup failed: TranslationNotFound or MessageFormatFailed.
public LookupFailureReason Reason { get; init; }
Property Value
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; }