Class MessageBase
Represents a translatable message.
public class MessageBase : PropertyChangedBase, INotifyPropertyChangedEx, INotifyPropertyChanged, IMessage, ITranslatableText
- Inheritance
-
PropertyChangedBaseMessageBase
- Implements
-
INotifyPropertyChangedEx
- Derived
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.PropertyChanged
Constructors
MessageBase()
Initializes a new instance of the MessageBase class.
protected MessageBase()
MessageBase(ITranslation)
Initializes a new instance of the MessageBase class.
public MessageBase(ITranslation translatableText)
Parameters
translatableText
ITranslationA localizable text.
Exceptions
- ArgumentNullException
Thrown when
translatableText
is null.
MessageBase(ITranslation, LogLevel, ILisrtModule, int?)
Initializes a new instance of the MessageBase class.
public MessageBase(ITranslation translatableText, LogLevel logLevel, ILisrtModule module = null, int? id = null)
Parameters
translatableText
ITranslationA localizable text.
logLevel
LogLevelLog level for the message.
module
ILisrtModuleOrigin module of the message.
id
int?A ID for the Message which can be null.
Properties
ID
Gets the message ID.
public virtual int? ID { get; }
Property Value
- int?
Level
Gets the log level.
public virtual LogLevel Level { get; }
Property Value
Module
Gets or sets the origin module.
public virtual ILisrtModule Module { get; protected set; }
Property Value
Text
Gets the localized message text.
public virtual string Text { get; }
Property Value
TimeStamp
Gets the message time stamp.
public virtual DateTime TimeStamp { get; }
Property Value
Methods
Translate(CultureInfo)
Translates the message to the given culture.
public virtual string Translate(CultureInfo culture)
Parameters
culture
CultureInfoCulture for the returning message.
Returns
- string
Localized message depending on the given CultureInfo.