public TimeSeparatorEventArgs(
     bool shouldAddSeparator,
     BaseChatDataItem previousItem,
     BaseChatDataItem item)
 {
     this.shouldAddSeparator = shouldAddSeparator;
     this.previousItem       = previousItem;
     this.item = item;
 }
Beispiel #2
0
        public override void Attach(BaseChatDataItem data, object context)
        {
            base.Attach(data, context);
            CardMessageDataItem data1       = this.Data as CardMessageDataItem;
            BaseChatCardElement cardElement = data1.ChatMessagesViewElement.ChatElement.ChatFactory.CreateCardElement(data1.CardMessage.CardDataItem);

            cardElement.CardActionClicked += new CardActionEventHandler(this.CardActionClicked);
            this.MainMessageElement.Children.Add((RadElement)cardElement);
        }
Beispiel #3
0
        public override void Synchronize()
        {
            BaseChatDataItem data = this.Data;

            if (this.Data.Message.TimeStamp.Date == DateTime.Now.Date)
            {
                this.Text = "TODAY";
            }
            else if (this.Data.Message.TimeStamp.Date == DateTime.Now.Date.AddDays(-1.0))
            {
                this.Text = "YESTERDAY";
            }
            else
            {
                this.Text = string.Format("{0:ddd dd,yyyy}", (object)this.Data.Message.TimeStamp).ToUpper();
            }
            this.Data.ChatMessagesViewElement.ChatElement.OnItemFormatting(new ChatItemElementEventArgs((BaseChatItemElement)this));
        }
Beispiel #4
0
        public virtual void AddMessage(ChatMessage message)
        {
            if (message.Author == null)
            {
                throw new ArgumentNullException("Author", "An author must be specified for each message added.");
            }
            bool             flag     = this.MessagesViewElement.VScrollBar.Value == this.MessagesViewElement.VScrollBar.Maximum - this.MessagesViewElement.VScrollBar.LargeChange + 1;
            BaseChatDataItem dataItem = this.ChatFactory.CreateDataItem(message);

            if (dataItem != null)
            {
                this.MessagesViewElement.Items.Add(dataItem);
            }
            ChatSuggestedActionsMessage suggestedActionsMessage = message as ChatSuggestedActionsMessage;

            if (suggestedActionsMessage != null)
            {
                this.SuggestedActionsElement.ClearActions();
                this.SuggestedActionsElement.AddActions(suggestedActionsMessage.SuggestedActions);
                this.SuggestedActionsElement.Visibility = ElementVisibility.Visible;
            }
            ChatOverlayMessage message1 = message as ChatOverlayMessage;

            if (message1 != null)
            {
                this.ShowOverlay(message1);
            }
            if (!flag)
            {
                return;
            }
            for (int index = 0; index < 3; ++index)
            {
                this.MessagesViewElement.VScrollBar.Value = this.MessagesViewElement.VScrollBar.Maximum - this.MessagesViewElement.VScrollBar.LargeChange + 1;
                Application.DoEvents();
            }
        }
 public override bool IsCompatible(BaseChatDataItem data, object context)
 {
     return((object)data.GetType() == (object)typeof(CarouselMessageDataItem));
 }
Beispiel #6
0
 public override bool IsCompatible(BaseChatDataItem data, object context)
 {
     return((object)data.GetType() == (object)typeof(ChatTimeSeparatorDataItem));
 }