Open sandboxFocus

Class MessageDispenser

Provides a base implementation of IMessageDispenser in which the message key is expected to have the format PRE0000, where PRE is a prefix and 0000 is an integer. Keys for help URLs have the format PRE0000?.

Inheritance
MessageDispenser
Implements
Namespace: PostSharp.Extensibility
Assembly: PostSharp.dll
Syntax
public abstract class MessageDispenser : IMessageDispenser
Remarks

Implement GetMessage(int), typically with a switch statement on the message number, and optionally GetHelpUrl(int). GetMessage(string) returns null when the key does not start with Prefix or when the rest of the key is not an integer. For example, with the prefix CUS, the key CUS001 resolves to the message number 1.

Pass an instance to the MessageSource constructor to emit the messages.

Constructors

Name Description
MessageDispenser(string)

Initializes a new instance of the MessageDispenser class.

Properties

Name Description
Prefix

Gets the message prefix.

Methods

Name Description
GetHelpUrl(int)

Returns the help URL of a given message number.

GetMessage(int)

Returns the message text of a given number.

GetMessage(string)

Returns the message text for a message key.

See Also