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(); })); }
/// <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(); } })); }
private void MsgBoard_TextChanged(object sender, EventArgs e) { MsgBoard.SelectionStart = MsgBoard.Text.Length; MsgBoard.ScrollToCaret(); }