public JsonResult Post(string method, string credit, int?id, int?subid, string time, string content, string pic)
 {
     if (credit == null)
     {
         return(ResponceModel.GetInstanceInvalid());
     }
     else
     {
         return(MsgBoard.Control(method, credit, id, subid, time, content, pic));
     }
 }
 /// <summary>
 /// add new message to chat board
 /// </summary>
 /// <param name="msg"></param>
 /// <param name="user"></param>
 private void AddMsgToBoard(string msg, string user)
 {
     this.Dispatcher.Invoke(new Action(() =>
     {
         MsgBoard.Text += Environment.NewLine +
                          DateTime.Now.ToString() +
                          " " +
                          user +
                          " say: " +
                          msg;
         MsgBoardScroll.ScrollToEnd();
         MsgBoard.UpdateLayout();
     }));
 }
Exemplo n.º 3
0
        /// <summary>
        /// add new message to chat board
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="user"></param>
        private void AddMsgToBoard(string msg, string user)
        {
            this.Dispatcher.Invoke(new Action(() =>
            {
                MsgBoard.Text += Environment.NewLine +
                                 DateTime.Now.ToString() +
                                 " " +
                                 user +
                                 " say: " +
                                 msg;
                MsgBoardScroll.ScrollToEnd();
                MsgBoard.UpdateLayout();
                if (!Application.Current.MainWindow.IsActive)
                {
                    FlashWindowHelper helper = new FlashWindowHelper();
                    helper.Flash(10, 300, new WindowInteropHelper(this).Handle);


                    MsgNotifyPlayer.Play();
                    // SystemSounds.Asterisk.Play();
                }
            }));
        }
Exemplo n.º 4
0
 private void MsgBoard_TextChanged(object sender, EventArgs e)
 {
     MsgBoard.SelectionStart = MsgBoard.Text.Length;
     MsgBoard.ScrollToCaret();
 }