private void Snipping_Load(object sender, EventArgs e) { cf = (ChatForm)this.Owner; this.Bounds = System.Windows.Forms.Screen.PrimaryScreen.Bounds; this.BackgroundImage = origin =api.GetScreenSnapShot(); graphics = this.CreateGraphics(); pen = new Pen(label9.BackColor); points = new GraphicsPath(); comboBox1.SelectedIndex = 0; this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); this.UpdateStyles(); }
// ���ܷÿ����� private void acceptToolStripButton_Click(object sender, EventArgs e) { try { acceptToolStripButton.Enabled = false; VisitorListViewItem vlvi = getSelectedVisitorListViewItem(); if (vlvi != null) { Chat chat = operaterServiceAgent.GetChatRequest(vlvi.Visitor.VisitorId); if (chat != null && vlvi.VisitSession.Status == VisitSessionStatus.ChatRequesting) { ChatForm cf = new ChatForm(operaterServiceAgent); Program.ChatForms.Add(cf); cf.Show(); cf.Accept(chat); } else { MessageBox.Show("�÷ÿ���ʱ��δ����Ի�"); } } } finally { acceptToolStripButton.Enabled = true; } }
//��������ÿ� private void inviteToolStripButton_Click(object sender, EventArgs e) { try { inviteToolStripButton.Enabled = false; VisitorListViewItem v = getSelectedVisitorListViewItem(); if (v != null && v.VisitSession.Status == VisitSessionStatus.Visiting) { if (!operaterServiceAgent.IsVisitorHasActiveChat(v.Visitor.VisitorId)) { ChatForm cf = new ChatForm(operaterServiceAgent); Program.ChatForms.Add(cf); cf.Show(); cf.Invite(v.Visitor.VisitorId); // should call after show } } else { MessageBox.Show("�÷ÿ��ѱ������ͷ�������ڶԻ���"); } } finally { inviteToolStripButton.Enabled = true; } }
private void acceptButton_Click(object sender, EventArgs e) { soundPlayerTimer.Stop(); ChatForm cf = null; foreach (var item in Program.ChatForms) { if (item.Chat.ChatId == this.chat.ChatId) { cf = item; break; } } if (cf == null) { cf = new ChatForm(Program.OperaterServiceAgent); Program.ChatForms.Add(cf); } cf.Show(); this.Hide(); cf.Accept(this.chat); timer.Stop(); }