123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- namespace FPER
- {
-
- public class _FIRE_LIST
- {
- public string FIRE_TIME;
- public bool FIRE_TYPE;
- public string FIRE_TEXT;
- }
- public class _Popup // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
-
- MDIParent mdi = null;
-
-
-
-
- private Form_Popup CommonPopup = new Form_Popup();
-
- public delegate void CreateFormCallback(Form Target);
- public delegate void CreateEtcFirePopupCallback(string MyReceiver_ID, string FireReceiver_ID, MDIParent Target);
-
- public Hashtable HASH_EtcReceiverFireAlarmPopup = new Hashtable();
-
-
-
-
-
- public Form_Popup_CutInfo Form_Popup_CutInfo_Main = null;
-
-
- public ArrayList Form_Popup_CutInfo_List = new ArrayList();
-
- public bool Form_Popup_CutInfo_Enable = false;
-
-
- public _Popup(MDIParent mdiparent)
- {
- mdi = mdiparent;
- }
-
- ~_Popup()
- {
- }
-
-
-
-
-
- public void CommonPopupShow(Form Target)
- {
- if (Target.InvokeRequired)
- {
- CreateFormCallback d = new CreateFormCallback(CommonPopupShow);
- Target.Invoke(d, new object[] { });
- }
- else
- {
-
- if (CommonPopup != null) CommonPopup.Close();
-
- CommonPopup = new Form_Popup();
-
- Target.FormClosing += new FormClosingEventHandler(Target_FormClosing);
- Target.VisibleChanged += new EventHandler(Target_VisibleChanged);
-
- CommonPopup.Show(Target);
-
- CommonPopup.StartPosition = FormStartPosition.CenterParent;
-
- CommonPopup.Update();
- }
- }
-
- public void Target_VisibleChanged(object sender, EventArgs e)
- {
- Form frm = (Form)sender;
- if (frm.Visible == false)
- CommonPopupClose(frm);
- }
-
- public void CommonPopupClose(Form Target)
- {
- if (Target.InvokeRequired)
- {
- CreateFormCallback d = new CreateFormCallback(CommonPopupClose);
- Target.Invoke(d, new object[] { });
- }
- else
- {
-
-
- if (CommonPopup != null)
- {
- CommonPopup.Hide();
- CommonPopup.Close();
- }
-
- Target.VisibleChanged -= new EventHandler(Target_VisibleChanged);
- Target.FormClosing -= new FormClosingEventHandler(Target_FormClosing);
- }
- }
-
- public void Target_FormClosing(object sender, FormClosingEventArgs e)
- {
-
- if (CommonPopup != null)
- {
- CommonPopup.Hide();
- CommonPopup.Close();
- }
- }
-
-
-
-
- public void EtcReceiverFirePopupShow(string MyReceiver_ID, string FireReceiver_ID, MDIParent Target)
- {
-
-
- if (MyReceiver_ID != FireReceiver_ID && HASH_EtcReceiverFireAlarmPopup.Count != 0)
- {
- if (HASH_EtcReceiverFireAlarmPopup.Contains(FireReceiver_ID) == true)
- {
- if (((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).Visible == false)
- {
- if (Target.InvokeRequired)
- {
- CreateEtcFirePopupCallback d = new CreateEtcFirePopupCallback(EtcReceiverFirePopupShow);
- Target.Invoke(d, new object[] { MyReceiver_ID, FireReceiver_ID, Target });
- }
- else
- {
-
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).Show();
-
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).StartPosition = FormStartPosition.CenterParent;
-
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).Update();
- }
- }
- }
- }
- }
-
- public void EtcReceiverFirePopupProcess(string MyReceiver_ID, string FireReceiver_ID, bool FireType, string FireDisplayText, string FireTime)
- {
-
-
- if (MyReceiver_ID != FireReceiver_ID && HASH_EtcReceiverFireAlarmPopup.Count != 0)
- {
- if (HASH_EtcReceiverFireAlarmPopup.Contains(FireReceiver_ID) == true)
- {
-
- if (((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).LIST_FIRE_INFO.Count > 14)
- {
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).LIST_FIRE_INFO.RemoveAt(0);
- }
-
- _FIRE_LIST FIRE_LIST = new _FIRE_LIST();
- FIRE_LIST.FIRE_TEXT = FireDisplayText;
- FIRE_LIST.FIRE_TYPE = FireType;
- FIRE_LIST.FIRE_TIME = FireTime;
-
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).LIST_FIRE_INFO.Add(FIRE_LIST);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
- }
- }
- }
|