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.
- C#
- VB.NET
public delegate void FormatMessageEventHandler(Object sender, MessageEventArgs e)
Public Delegate Sub FormatMessageEventHandler(ByVal sender As [Object], ByVal e As MessageEventArgs)
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
| Name | Type | Description |
|---|---|---|
| sender | Object | The source of the event, the ChatBox. |
| e | MessageEventArgs | An instance of MessageEventArgs containing the message event data. |
Fired By
| Name | Description |
|---|---|
| ChatBox.FormatMessage | Fired when a message is posted to the ChatBox, before it is rendered. |