예제 #1
0
        protected virtual void SubmitUserMessage()
        {
            string text = this.inputTextBox.Text;

            if (TelerikHelper.StringIsNullOrWhiteSpace(text))
            {
                return;
            }
            this.inputTextBox.Text = string.Empty;
            ChatTextMessage chatTextMessage = new ChatTextMessage(text, this.Author, DateTime.Now);

            if (this.AutoAddUserMessages)
            {
                if (this.Author == null)
                {
                    throw new ArgumentNullException("Author", "The Author property has to be set to a valid instance when AutoAddUserMessages is set to true.");
                }
                this.AddMessage((ChatMessage)chatTextMessage);
            }
            if (this.IsPopupOverlayShown)
            {
                this.HideOverlay();
            }
            this.OnSendMessage(new SendMessageEventArgs((ChatMessage)chatTextMessage));
        }
예제 #2
0
        protected virtual void OnOkClicked()
        {
            RadChatElement  chatElement     = this.ChatElement;
            ChatTextMessage chatTextMessage = new ChatTextMessage(Convert.ToString(this.CurrentValue), chatElement.Author, DateTime.Now);

            if (chatElement.AutoAddUserMessages)
            {
                chatElement.AddMessage((ChatMessage)chatTextMessage);
            }
            chatElement.HideOverlay();
            chatElement.OnSendMessage(new SendMessageEventArgs((ChatMessage)chatTextMessage));
        }