TimeBreak mechanism of
RadChat is intended to encapsulate a group of messages for a given time interval. It can be either added manually or automatically.
RadChat can automatically add a TimeBreak at a given interval. This can achieved by setting the
AutoIncludeTimeBreaks property of RadChat to True. Also, the needed
TimeSpan needs to be set to the
TimeBreakInterval property of the control.
RadChat provides the
AddTimeBreak method for adding a
TimeBreak, which accepts a string parameter for its header.
var firstTextMessage = new TextMessage(this.otherAuthor, "Hello Stenly! How are you?"); var secondTextMessage = new TextMessage(this.otherAuthor, "I hope I find you well!"); var thirdTextMessage = new TextMessage(this.otherAuthor, "How is family? "); this.chat.AddMessage(firstTextMessage); this.chat.AddMessage(secondTextMessage); this.chat.AddMessage(thirdTextMessage); this.chat.AddTimeBreak(DateTime.Now.DayOfWeek.ToString() + " " + DateTime.Now.TimeOfDay.Hours.ToString() + " : " + DateTime.Now.TimeOfDay.Minutes.ToString());
AddingTimeBreak event provides various information regarding the last
MessageGroup and the
Messages in it. Also, the event can be canceled. The following event arguments are exposed for this purpose.
Cancel: The event can be canceled by setting the property to True.
Header: Provides information regarding the current
Headerthat is to be set for the
The LastMessageGroup itself provides the following information.
Alignment: Gets the alignment of the
Author: The group's Author instance.
AvatarAlignment: Gets the alignment of the
Avataraccording to the
CreationDate: Gets the time when the first
Messageof the group was created.
Messages: The collection of all messages within the group.