void T() { while (!Timer_State.getinstance().Stopping) { ThreadPool.QueueUserWorkItem(WC); Thread.Sleep(interval); } }
/// <summary> /// 윈폼과 이 클래스를 연결, 연결하면 윈폼이 종료될때 /// 이 클래스에 저장된 모든 스레드들을 먼저 종료 후 윈폼 종료 /// </summary> /// <param name="form">연결할 윈폼</param> /// <returns></returns> public static Timer_State getinstance(System.Windows.Forms.Form form) { if (instance == null) { instance = new Timer_State(); } form.FormClosing += new System.Windows.Forms.FormClosingEventHandler(instance.formclosing); return(instance); }
public static Timer_State getinstance() { if (instance == null) { instance = new Timer_State(); } return(instance); }