Skip to main content

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.

public delegate void SendingMessageEventHandler(Object sender, SendingMessageEventArgs e)

Example:

chatBox.SendingMessage += (object sender, SendingMessageEventArgs e) =>
{
// block empty or whitespace-only messages.
if (String.IsNullOrWhiteSpace(e.Message.Content))
e.Cancel = true;
};

Parameters​

NameTypeDescription
senderObjectThe source of the event, the ChatBox.
eSendingMessageEventArgsAn instance of SendingMessageEventArgs containing event data. Set Cancel to true to prevent the message from being displayed.

Fired By​

NameDescription
ChatBox.SendingMessageFired before a message is sent.