Skip to main content

FormatMessageEventHandler

Namespace: Wisej.Web.Ext.ChatControl

Assembly: Wisej.Web.Ext.ChatControl (4.1.0.0)

Represents the method that will handle the FormatMessage event, fired when a message is added to the ChatBox and can be formatted before it is displayed.

public delegate void FormatMessageEventHandler(Object sender, MessageEventArgs e)

The handler runs before the message control is created, so changes to Content, ContentType or BubbleVisible are reflected in the rendered message.

Example:

chatBox.FormatMessage += (object sender, MessageEventArgs e) =>
{
// render messages from other users in bold.
if (!e.IsChatBoxUser)
e.Message.Content = "<b>" + e.Message.Content + "</b>";
};

Parameters​

NameTypeDescription
senderObjectThe source of the event, the ChatBox.
eMessageEventArgsAn instance of MessageEventArgs containing the message event data.

Fired By​

NameDescription
ChatBox.FormatMessageFired when a message is posted to the ChatBox, before it is rendered.