示例#1
0
 /// <remarks/>
 public void AddMessageAsync(System.Guid key, ChatMessage msg) {
     this.AddMessageAsync(key, msg, null);
 }
示例#2
0
 /// <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);
 }
示例#3
0
 public void AddMessage(System.Guid key, ChatMessage msg) {
     this.Invoke("AddMessage", new object[] {
                 key,
                 msg});
 }
示例#4
0
        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);
            }
        }
示例#5
0
		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);
			}
		}
示例#6
0
        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);
            }
        }
示例#7
0
        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);
        }