Table of Contents

Class MessageBase

Namespace
Loehnert.Lisrt.Messaging
Assembly
Loehnert.Lisrt.dll

Represents a translatable message.

public class MessageBase : PropertyChangedBase, INotifyPropertyChangedEx, INotifyPropertyChanged, IMessage, ITranslatableText
Inheritance
PropertyChangedBase
MessageBase
Implements
INotifyPropertyChangedEx
Derived
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.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 ITranslation

A 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 ITranslation

A localizable text.

logLevel LogLevel

Log level for the message.

module ILisrtModule

Origin 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

LogLevel

Module

Gets or sets the origin module.

public virtual ILisrtModule Module { get; protected set; }

Property Value

ILisrtModule

Text

Gets the localized message text.

public virtual string Text { get; }

Property Value

string

TimeStamp

Gets the message time stamp.

public virtual DateTime TimeStamp { get; }

Property Value

DateTime

Methods

Translate(CultureInfo)

Translates the message to the given culture.

public virtual string Translate(CultureInfo culture)

Parameters

culture CultureInfo

Culture for the returning message.

Returns

string

Localized message depending on the given CultureInfo.