Example #1
0
        /// <summary>
        /// Sends the message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void SendMessage(string message)
        {
            this.Messages.Add(
                new ChatMessageModel("You", message, DateTime.Now));

            var model = new SendChatMessage()
            {
                MessageType = "send",
                Service = "chat",
                Message = message,
                To = Chatee.UserName,
                From = Me,
                TimeStamp = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + DateTime.Now.ToString("zzz")
            };

            if (this.Send != null)
            {
                this.Send(model);
            }
        }
Example #2
0
        /// <summary>
        /// Sends the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Send(SendChatMessage message)
        {
            this.SendMessage(message);

            if (this.Preferences.SaveChatLogs)
            {
                // log
                this.Log(
                        message.To,
                        message.Message,
                        "You",
                        DateTime.Parse(message.TimeStamp));
            }
        }