Show / Hide Table of Contents

Class LocalizedException

Base class for exceptions that carry a localizable user-facing message. Subclasses override GetLocalizedMessage(CultureInfo) to resolve translations. The constructor receives only a localization key; the default culture resource file is the source of strings.

Inheritance
object
Exception
LocalizedException
Implements
ISerializable
Inherited Members
Exception.GetBaseException()
Exception.GetType()
Exception.ToString()
Exception.Data
Exception.HelpLink
Exception.HResult
Exception.InnerException
Exception.Message
Exception.Source
Exception.StackTrace
Exception.TargetSite
Exception.SerializeObjectState
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Zaya.Primitives
Assembly: Zaya.Primitives.dll
Syntax
public class LocalizedException : Exception, ISerializable

Constructors

| Edit this page View Source

LocalizedException(string)

Initializes a new instance of the LocalizedException class.

Declaration
protected LocalizedException(string key)
Parameters
Type Name Description
string key

Localization resource key (e.g. "Ocr_Err_SnippingToolNotFound").

Methods

| Edit this page View Source

GetLocalizedMessage(CultureInfo)

Returns the user-facing localized message for the specified culture. The base implementation returns the key as a fallback. Override to resolve via a resource manager.

Declaration
public virtual string GetLocalizedMessage(CultureInfo culture)
Parameters
Type Name Description
CultureInfo culture

The target culture for localization.

Returns
Type Description
string

The localized error message.

Implements

ISerializable
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX