public static void CloseForm(TransferNotiForm form) { try { Logger.info("CloseForm:TransferNotiForm 닫기"); lock (lockObject) { if (transferAreas.ContainsKey(form.Top)) { transferAreas[form.Top] = AreaToUse.EMPTY; } bool result = notiForms.Remove(form); if (result) { Logger.info("CloseForm: notiForms에서 form삭제"); } else { Logger.info("CloseForm: notiForms에서 form삭제실패-Not found."); } form.Close(); } } catch (Exception ex) { Logger.error(ex.ToString()); } }
public static void AddForm(string ani, string name) { int screenWidth = Screen.PrimaryScreen.WorkingArea.Width; int screenHeight = Screen.PrimaryScreen.WorkingArea.Height; lock (lockObject) { int availableTop = GetAvailableTop(); TransferNotiForm miniform = new TransferNotiForm(ani, name); miniform.SetBounds(screenWidth - miniform.Width, availableTop, miniform.Width, miniform.Height); miniform.TopLevel = true; miniform.Show(); transferAreas[availableTop] = AreaToUse.USED; notiForms.Add(miniform); } }
private static void RemoveFirst() { try { Logger.info("TransferNotiForm 가장 오래된 것 삭제"); lock (lockObject) { TransferNotiForm miniform = (TransferNotiForm)notiForms[0]; if (transferAreas.ContainsKey(miniform.Top)) { transferAreas[miniform.Top] = AreaToUse.EMPTY; } miniform.Close(); notiForms.RemoveAt(0); } } catch (Exception ex) { Logger.error(ex.ToString()); } }
private void showAnswerCallInfo(string ANI, string name) { try { int height_point = 0; if (TransferNotiArea.Count > 0) { foreach (DictionaryEntry de in TransferNotiArea) { if (de.Value.ToString().Equals("0")) { int temp = Convert.ToInt32(de.Key.ToString()); if (temp > height_point) { height_point = temp; } } else { logWrite("TransferNotiArea[" + de.Key.ToString() + "] = " + de.Value.ToString()); logWrite(de.Key.ToString() + " is not 0"); } } if (height_point == 0) { //가장 오래된 태그폼 삭제 NoParamDele dele = new NoParamDele(closeNoticeForm); Invoke(dele); foreach (DictionaryEntry de in TransferNotiArea) { if (de.Value.ToString().Equals("0")) { int temp = Convert.ToInt32(de.Key.ToString()); if (temp > height_point) { height_point = temp; } } else { logWrite("TransferNotiArea[" + de.Key.ToString() + "] = " + de.Value.ToString()); logWrite(de.Key.ToString() + " is not 0"); } } } } TransferNotiForm miniform = new TransferNotiForm(); miniform.TopMost = false; miniform.pbx_icon.Image = global::Client.Properties.Resources.phone_black; miniform.pbx_close.Visible = true; miniform.pbx_close.MouseClick += new MouseEventHandler(pbx_close_MouseClick); miniform.pbx_icon.MouseClick += new MouseEventHandler(pbx_icon_MouseClick); miniform.MouseClick += new MouseEventHandler(miniform_MouseClick_for_Call); miniform.label_Customer.MouseClick += new MouseEventHandler(label_Customer_MouseClick_for_Call); miniform.label_from.MouseClick += new MouseEventHandler(label_Customer_MouseClick_for_Call); if (name.Length > 1) { miniform.label_Customer.Text = name + "(" + ANI + ")"; } else { miniform.label_Customer.Text = ANI; } //miniform.label_from.Text = notifyform.label_sender.Text; //miniform.label_ani.Text = notifyform.label_ani.Text; //miniform.label_date.Text = notifyform.label_TONGDATE.Text; //miniform.label_time.Text = notifyform.label_TONGTIME.Text; miniform.label_from.Text = "시간 : "+ DateTime.Now.ToShortTimeString(); screenWidth = Screen.PrimaryScreen.WorkingArea.Width; screenHeight = Screen.PrimaryScreen.WorkingArea.Height; miniform.SetBounds(screenWidth - miniform.Width, height_point, miniform.Width, miniform.Height); miniform.Show(); TransferNotiArea[height_point.ToString()] = "1"; NotiFormList.Add(miniform); } catch (Exception ex) { logWrite(ex.ToString()); } }
private void timerForNotify_Tick(object sender, EventArgs e) { try { if (notifyform != null) { timerForNotify.Stop(); int height_point = 0; if (TransferNotiArea.Count > 0) { foreach (DictionaryEntry de in TransferNotiArea) { if (de.Value.ToString().Equals("0")) { int temp = Convert.ToInt32(de.Key.ToString()); if (temp > height_point) { height_point = temp; } } else { logWrite("TransferNotiArea[" + de.Key.ToString() + "] = " + de.Value.ToString()); logWrite(de.Key.ToString() + " is not 0"); } } if (height_point == 0) { //가장 오래된 태그폼 삭제 NoParamDele dele = new NoParamDele(closeNoticeForm); Invoke(dele); foreach (DictionaryEntry de in TransferNotiArea) { if (de.Value.ToString().Equals("0")) { int temp = Convert.ToInt32(de.Key.ToString()); if (temp > height_point) { height_point = temp; } } else { logWrite("TransferNotiArea[" + de.Key.ToString() + "] = " + de.Value.ToString()); logWrite(de.Key.ToString() + " is not 0"); } } } } TransferNotiForm miniform = new TransferNotiForm(); miniform.pbx_icon.Image = global::Client.Properties.Resources.img_customer; miniform.MouseClick += new MouseEventHandler(miniform_MouseClick); miniform.pbx_icon.MouseClick+=new MouseEventHandler(pbx_icon_MouseClick_for_Transfer); miniform.label_Customer.MouseClick += new MouseEventHandler(label_Customer_MouseClick); miniform.label_from.MouseClick += new MouseEventHandler(label_Customer_MouseClick); miniform.label_Customer.Text = notifyform.label_Customer.Text; miniform.label_from.Text = notifyform.label_sender.Text; miniform.label_ani.Text = notifyform.label_ani.Text; miniform.label_date.Text = notifyform.label_TONGDATE.Text; miniform.label_time.Text = notifyform.label_TONGTIME.Text; miniform.label_senderid.Text = notifyform.label_senderid.Text; screenWidth = Screen.PrimaryScreen.WorkingArea.Width; screenHeight = Screen.PrimaryScreen.WorkingArea.Height; miniform.SetBounds(screenWidth - miniform.Width, height_point, miniform.Width, miniform.Height); notifyform.Close(); notifyform = null; miniform.TopLevel = true; miniform.Show(); TransferNotiArea[height_point.ToString()] = "1"; NotiFormList.Add(miniform); } } catch (Exception ex) { logWrite(ex.ToString()); } }