private void fresh(object sender, TimesUpEventArgs args)// 猫叫事件处理, { if (args.CurrentGroup == 3) { string sID = DateTime.Now.ToString(); Console.WriteLine(sID + ":Group3 start refresh"); Thread.Sleep(15 * 1000); Console.WriteLine(sID + ":Group3 refresh finish!"); } }
public event EventHandler <TimesUpEventArgs> TimesUpEvent; //更新组事件 public void OnTimesUp(int iGroupName) // 事件发生 { TimesUpEventArgs args = new TimesUpEventArgs(iGroupName); Console.WriteLine(args);//tostring方法 if (TimesUpEvent != null) { TimesUpEvent(this, args); } }