SendingMessageEventHandler
Namespace: Wisej.Web.Ext.ChatControl
Assembly: Wisej.Web.Ext.ChatControl (4.1.0.0)
Represents the method that will handle the SendingMessage event, fired when the user submits a message through the chat UI, before it is added to the ChatBox.
- C#
- VB.NET
public delegate void SendingMessageEventHandler(Object sender, SendingMessageEventArgs e)
Public Delegate Sub SendingMessageEventHandler(ByVal sender As [Object], ByVal e As SendingMessageEventArgs)
Example:
chatBox.SendingMessage += (object sender, SendingMessageEventArgs e) =>
{
// block empty or whitespace-only messages.
if (String.IsNullOrWhiteSpace(e.Message.Content))
e.Cancel = true;
};
Parameters
| Name | Type | Description |
|---|---|---|
| sender | Object | The source of the event, the ChatBox. |
| e | SendingMessageEventArgs | An instance of SendingMessageEventArgs containing event data. Set Cancel to true to prevent the message from being displayed. |
Fired By
| Name | Description |
|---|---|
| ChatBox.SendingMessage | Fired before a message is sent. |