ChatMessage
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)
Represents one message in the chat transcript.
- C#
- VB.NET
public class ChatMessage
Public Class ChatMessage
Constructors
ChatMessage()
Initializes a new instance of ChatMessage.
Properties
AttachedFile
ChatAttachment: Gets or sets the Syncfusion attachedFile value for this MessageModel. (Default: null)
Author
ChatUser: Gets or sets the user that authored the message. (Default: null)
When the value is null, AddMessage assigns a copy of the current User of the chat.
Id
String: Gets or sets the unique message identifier. (Default: "")
The identifier is used by UpdateMessage, RemoveMessage and ScrollToMessage to find the message. When the value is empty, AddMessage assigns a new unique identifier.
IsForwarded
Boolean: Gets or sets whether the message is marked as forwarded. (Default: False)
IsPinned
Boolean: Gets or sets whether the message is pinned. (Default: False)
MentionUsers
ChatUser[]: Gets or sets the users referenced by placeholders in Text. (Default: null)
The placeholder {0} in Text is rendered as a mention of the first user of the array, {1} as a mention of the second one and so on.
Example:
The following example creates a message that mentions a user.
var message = new Chat.ChatMessage
{
Author = chat.User,
Text = "{0} can you review the document?",
MentionUsers = new[] { new Chat.ChatUser { Id = "u2", User = "Syncfusion Bot" } }
};
chat.AddMessage(message);
ReplyTo
MessageReply: Gets or sets the message being replied to. (Default: null)
The value is a copy of the relevant fields of the original message: MessageID links the reply to it, the other fields are displayed in the reply preview.
Example:
The following example adds a reply to the last message of the conversation.
Chat.ChatMessage target = chat.Messages.Last();
chat.AddMessage(new Chat.ChatMessage
{
Author = chat.User,
Text = "I agree.",
ReplyTo = new Chat.MessageReply
{
MessageID = target.Id,
Text = target.Text,
Timestamp = target.TimeStamp,
User = target.Author
}
});
Status
MessageStatus: Gets or sets the message delivery status. (Default: null)
Text
String: Gets or sets the message content. Syncfusion mentions use placeholders such as {0}. (Default: "")
TimeStamp
DateTime: Gets or sets the message timestamp. (Default: 1/1/0001 12:00:00 AM)
When the value is not set, AddMessage assigns the current date and time.
TimeStampFormat
String: Gets or sets the timestamp display format. (Default: "")
The value is a Syncfusion date format pattern, for example hh:mm a, that applies to this message only. The format of all the other messages is set through TimeStampFormat.