/// <remarks/> public void AddMessageAsync(System.Guid key, ChatMessage msg) { this.AddMessageAsync(key, msg, null); }
/// <remarks/> public void AddMessageAsync(System.Guid key, ChatMessage msg, object userState) { if ((this.AddMessageOperationCompleted == null)) { this.AddMessageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMessageOperationCompleted); } this.InvokeAsync("AddMessage", new object[] { key, msg}, this.AddMessageOperationCompleted, userState); }
public void AddMessage(System.Guid key, ChatMessage msg) { this.Invoke("AddMessage", new object[] { key, msg}); }
private void btnTransfer_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to transfer the chat session?", "Transfering chat", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ChatRequest newReq = new ChatRequest(); newReq.OperatorId = Program.CurrentOperator.OperatorId; if (chkWarnVisitor.Checked) { ChatMessage msg = new ChatMessage(); msg.ChatId = ChatId; msg.Message = "Your chat session has been transfered to : " + cboOperators.Text; msg.Name = "System"; //msg.SentDate = DateTime.Now.ToUniversalTime().Ticks; ws.AddMessage(new Guid(Program.CurrentOperator.Password), msg); } ((ControlPanel)this.ParentForm).EndChat(null, ChatId); ws.TransferChat(newReq); } }
private void btnCloseChat_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to exit the chat session?", "Ending chat session", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ChatMessage msg = new ChatMessage(); msg.MessageId = -1; msg.ChatId = myChatRequest.ChatId; msg.Message = "The operator has left the chat session..."; msg.Name = "System"; //msg.SentDate = DateTime.Now.ToUniversalTime().Ticks; ws.AddMessage(new Guid(Program.CurrentOperator.Password), msg); ((ControlPanel)this.ParentForm).EndChat(MyTab, myChatRequest.ChatId); } }
private void txtMsg_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape && MessageBox.Show("Are you sure you want to exit the chat session?", "Ending chat session", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { tmrGetMsg.Enabled = false; ChatMessage msg = new ChatMessage(); msg.MessageId = -1; msg.ChatId = myChatRequest.ChatId; msg.Message = "The operator has left the chat session..."; msg.Name = "System"; //msg.SentDate = DateTime.Now.ToUniversalTime().Ticks; ws.AddMessage(new Guid(Program.CurrentOperator.Password), msg); ((ControlPanel)this.ParentForm).EndChat((TabPage)this.Parent, myChatRequest.ChatId); } }
private void WriteMessage(string message, string From) { ChatMessage msg = new ChatMessage(); msg.MessageId = -1; msg.ChatId = myChatRequest.ChatId; msg.Message = message; msg.Name = From; //msg.SentDate = DateTime.Now.ToUniversalTime().Ticks; ws.AddMessage(new Guid(Program.CurrentOperator.Password), msg); }