public void DisplayOnNoticeResultFromDBReceived(object sender, CustomEventArgs e)//t|ntime†content†nmode†title†안읽은사람1:안읽은사람2:...|... { Logger.info("DisplayOnNoticeResultFromDBReceived 실행"); try { string[] tempMsg = (string[])e.GetItem; if (noticeresultform == null || noticeresultform.IsDisposed) { noticeresultform = new NoticeResultForm(); } foreach (string strarr in tempMsg) //ntime†content†nmode†title†안읽은사람1:안읽은사람2:... { if (strarr.Equals("t")) { continue; } Logger.info(strarr); UserListedNoticeObj noticeInfo = new UserListedNoticeObj(strarr); noticeresultform.AddItem(noticeInfo); //발송 공지 항목 각각의 상세 확인 리스트폼 생성 if (noticeInfo.UnReaders != null && noticeInfo.UnReaders.Count > 0) { NoticeDetailForms.AddForm(noticeInfo.NoticeTime, noticeInfo.UnReaders); } } noticeresultform.Show(); } catch (Exception ex) { Logger.error(ex.ToString()); } }
public void RegisterNotice(object sender, CustomEventArgs e)//bool isEmergency, string title, string content) { try { NoticeObj obj = (NoticeObj)(e.GetItem); if (noticeresultform == null || noticeresultform.IsDisposed) { noticeresultform = new NoticeResultForm(); } noticeresultform.AddItem(obj); connection.SendMsgRegisterNotice(obj); } catch (Exception ex) { Logger.error(ex.ToString()); } }
public void LogoutFormClose() { //로그아웃 전에 열린 폼 닫기 및 정보테이블 삭제 //자원해제 대상 //private Hashtable ChatFormList = new Hashtable(); //채팅창 key=id, value=chatform //private Hashtable MemoFormList = new Hashtable(); //key=time, value=SendMemoForm //private Hashtable TeamInfoList = new Hashtable(); //key=id, value=team //private Hashtable InList = new Hashtable(); //key=id, value=IPEndPoint //private Hashtable MemberInfoList = new Hashtable(); //private Hashtable FileSendDetailList = new Hashtable(); //private Hashtable FileSendFormList = new Hashtable(); //private Hashtable FileSendThreadList = new Hashtable(); //private Hashtable FileReceiverThreadList = new Hashtable(); //private Hashtable NoticeDetailForm = new Hashtable(); //private Hashtable treesource = new Hashtable(); //private ArrayList MemoTable = new ArrayList(); //private ArrayList omitteamlist = new ArrayList(); try { if (noticelistform != null) { noticelistform.Close(); noticelistform = null; } if (noticeresultform != null) { noticeresultform.Close(); noticeresultform = null; } if (noreceiveboardform != null) { noreceiveboardform.Close(); noreceiveboardform = null; } if (ChatFormList.Count != 0) { foreach (DictionaryEntry de in ChatFormList) { if (de.Value != null) { try { ChatForm form = (ChatForm)de.Value; form.Dispose(); } catch (Exception e) { logWrite("form.Dispose() 에러 : " + e.ToString()); } } } ChatFormList.Clear(); logWrite("ChatFormList Clear!"); } if (MemoFormList.Count != 0) { foreach (DictionaryEntry de in MemoFormList) { if (de.Value != null) { try { SendMemoForm form = (SendMemoForm)de.Value; form.Dispose(); } catch (Exception e) { logWrite("form.Dispose() 에러 : " + e.ToString()); } } } MemoFormList.Clear(); logWrite("MemoFormList Clear!"); } TeamInfoList.Clear(); InList.Clear(); MemberInfoList.Clear(); FileSendDetailList.Clear(); if (FileSendFormList.Count != 0) { foreach (DictionaryEntry de in FileSendFormList) { if (de.Value != null) { try { SendFileForm form = (SendFileForm)de.Value; form.Dispose(); } catch (Exception e) { logWrite("form.Dispose() 에러 : " + e.ToString()); } } } FileSendFormList.Clear(); logWrite("FileSendFormList Clear!"); } FileSendThreadList.Clear(); FileReceiverThreadList.Clear(); FtpClientThreadList.Clear(); if (NoticeDetailForm.Count != 0) { foreach (DictionaryEntry de in NoticeDetailForm) { if (de.Value != null) { try { NoticeDetailResultForm form = (NoticeDetailResultForm)de.Value; form.Dispose(); } catch (Exception e) { logWrite("form.Dispose() 에러 : " + e.ToString()); } } } NoticeDetailForm.Clear(); logWrite("NoticeDetailForm Clear!"); } treesource.Clear(); if (MemoTable.Count != 0) { foreach (MemoForm memoform in MemoTable) { memoform.Dispose(); } MemoTable.Clear(); logWrite("MemoTable Clear!"); } omitteamlist.Clear(); } catch (Exception e) { logWrite(e.ToString()); } }
private void showNoticeResultFromDB(string[] tempMsg)// ntime†content†nmode†title†안읽은사람1:안읽은사람2:... { logWrite("showNoticeResultFromDB 실행"); string noticetime = ""; string title = ""; string content = ""; string mode = ""; ArrayList notreader = new ArrayList(); try { if (isMadeNoticeResult == false) { if (noticeresultform != null) noticeresultform.Close(); noticeresultform = new NoticeResultForm(); noticeresultform.listView1.Click += new EventHandler(listView1_Click); noticeresultform.FormClosing += new FormClosingEventHandler(noticeresultform_FormClosing); noticeresultform.FormClosed += new FormClosedEventHandler(noticeresultform_FormClosed); foreach (string strarr in tempMsg) { logWrite(strarr); string[] itemarr = strarr.Split('†'); if (itemarr.Length > 3) { noticetime = itemarr[0]; content = itemarr[1]; mode = itemarr[2]; title = itemarr[3]; string[] readers = itemarr[4].Split(':'); foreach (string readerid in readers) { if (readerid.Trim().Length > 0) { notreader.Add(readerid.Trim()); } } //발송 공지 항목을 리스트에 추가 ListViewItem item = noticeresultform.listView1.Items.Add(noticetime, "자세히", null); item.Tag = noticetime; item.SubItems.Add(noticetime); if (mode.Equals("e")) { item.SubItems.Add("긴급"); } else { item.SubItems.Add("일반"); } item.SubItems.Add(title); item.SubItems.Add(content); //발송 공지 항목 각각의 상세 확인 리스트폼 생성 NoticeDetailResultForm noticedetailresultform = new NoticeDetailResultForm(); noticedetailresultform.FormClosing += new FormClosingEventHandler(noticedetailresultform_FormClosing); foreach (DictionaryEntry de in MemberInfoList) { string receiver = de.Value.ToString() + "(" + de.Key.ToString() + ")"; ListViewItem ditem = noticedetailresultform.listView1.Items.Add(de.Key.ToString(), receiver, null); if (notreader.Contains(de.Key.ToString())) { ditem.ForeColor = Color.Red; ListViewItem.ListViewSubItem subitem = ditem.SubItems.Add("확인안함"); } else { ditem.ForeColor = Color.Blue; ListViewItem.ListViewSubItem subitem = ditem.SubItems.Add("읽음"); } } NoticeDetailForm[noticetime] = noticedetailresultform; } } } else { foreach (string strarr in tempMsg) { string[] itemarr = strarr.Split('†'); if (itemarr.Length > 3) { noticetime = itemarr[0]; content = itemarr[1]; mode = itemarr[2]; title = itemarr[3]; string[] readers = itemarr[4].Split(':'); foreach (string readerid in readers) { if (readerid.Trim().Length > 0) { notreader.Add(readerid.Trim()); } } ListView.ListViewItemCollection collection = noticeresultform.listView1.Items; bool isexist = false; foreach (ListViewItem row in collection) { if (noticetime.Equals(row.Tag.ToString().Trim())) { isexist = true; break; } } if (isexist == false) { ListViewItem item = noticeresultform.listView1.Items.Add(noticetime, "자세히", null); item.Tag = noticetime; item.SubItems.Add(noticetime); item.SubItems.Add(mode); item.SubItems.Add(title); item.SubItems.Add(content); NoticeDetailResultForm noticedetailresultform = new NoticeDetailResultForm(); noticedetailresultform.FormClosing += new FormClosingEventHandler(noticedetailresultform_FormClosing); foreach (DictionaryEntry de in MemberInfoList) { string receiver = de.Value.ToString() + "(" + de.Key.ToString() + ")"; ListViewItem ditem = noticedetailresultform.listView1.Items.Add(de.Key.ToString(), receiver, null); if (notreader.Contains(de.Key.ToString())) { ditem.ForeColor = Color.Red; ListViewItem.ListViewSubItem subitem = ditem.SubItems.Add("확인안함"); } else { ditem.ForeColor = Color.Blue; ListViewItem.ListViewSubItem subitem = ditem.SubItems.Add("읽음"); } } NoticeDetailForm[noticetime] = noticedetailresultform; } } } } noticeresultform.Show(); } catch (Exception e) { logWrite(e.ToString()); } }
private void MakeNoticeResult(string noticetime, string title, string content, string mode) { try { if (isMadeNoticeResult == false) { if (noticeresultform != null) noticeresultform.Close(); noticeresultform = new NoticeResultForm(); noticeresultform.listView1.Click += new EventHandler(listView1_Click); noticeresultform.FormClosing += new FormClosingEventHandler(noticeresultform_FormClosing); noticeresultform.FormClosed += new FormClosedEventHandler(noticeresultform_FormClosed); ListViewItem item = noticeresultform.listView1.Items.Add(noticetime, "자세히", null); item.Tag = noticetime; item.SubItems.Add(noticetime); item.SubItems.Add(mode); item.SubItems.Add(title); item.SubItems.Add(content); NoticeDetailResultForm noticedetailresultform = new NoticeDetailResultForm(); noticedetailresultform.FormClosing += new FormClosingEventHandler(noticedetailresultform_FormClosing); foreach (DictionaryEntry de in MemberInfoList) { string receiver = de.Value.ToString() + "(" + de.Key.ToString() + ")"; ListViewItem ditem = noticedetailresultform.listView1.Items.Add(de.Key.ToString(), receiver, null); ditem.ForeColor = Color.Red; ListViewItem.ListViewSubItem subitem = ditem.SubItems.Add("확인 안함"); } isMadeNoticeResult = true; NoticeDetailForm[noticetime] = noticedetailresultform; } else { ListViewItem item = noticeresultform.listView1.Items.Add(noticetime, "자세히", null); item.Tag = noticetime; item.SubItems.Add(noticetime); item.SubItems.Add(mode); item.SubItems.Add(title); item.SubItems.Add(content); NoticeDetailResultForm noticedetailresultform = new NoticeDetailResultForm(); noticedetailresultform.FormClosing += new FormClosingEventHandler(noticedetailresultform_FormClosing); foreach (DictionaryEntry de in MemberInfoList) { string receiver = de.Value.ToString() + "(" + de.Key.ToString() + ")"; ListViewItem ditem = noticedetailresultform.listView1.Items.Add(de.Key.ToString(), receiver, null); ditem.ForeColor = Color.Red; ditem.SubItems.Add("확인 안함"); } NoticeDetailForm[noticetime] = noticedetailresultform; } } catch (Exception e) { logWrite(e.ToString()); } }
public void DisplayOnNoticeResultFromDBReceived(object sender, CustomEventArgs e)//t|ntime†content†nmode†title†안읽은사람1:안읽은사람2:...|... { Logger.info("DisplayOnNoticeResultFromDBReceived 실행"); try { string[] tempMsg = (string[])e.GetItem; if (noticeresultform == null || noticeresultform.IsDisposed) noticeresultform = new NoticeResultForm(); foreach (string strarr in tempMsg) //ntime†content†nmode†title†안읽은사람1:안읽은사람2:... { if (strarr.Equals("t")) continue; Logger.info(strarr); UserListedNoticeObj noticeInfo = new UserListedNoticeObj(strarr); noticeresultform.AddItem(noticeInfo); //발송 공지 항목 각각의 상세 확인 리스트폼 생성 if (noticeInfo.UnReaders != null && noticeInfo.UnReaders.Count > 0) NoticeDetailForms.AddForm(noticeInfo.NoticeTime, noticeInfo.UnReaders); } noticeresultform.Show(); } catch (Exception ex) { Logger.error(ex.ToString()); } }