public static Countdown Queue(TimeSpan delay, DelayedAction action) { var counter = new Countdown(); counter.Elapsed += (object sender, EventArgs e) => action(); counter.Start(delay); return counter; }
public TestForm(Engine engine) { InitializeComponent(); #if DEBUG TopMost = false; #endif _engine = engine; _random = new Random(); _muteTimer = new Countdown(); _muteTimer.Elapsed += MuteTimer_Elapsed; _vitalTimer = new Countdown(); _vitalTimer.Elapsed += VitalTimer_Elapsed; }
public Engine() { _napTimer = new Countdown(); _napTimer.Elapsed += NapTimer_Elapsed; _graceTimer = new Countdown(); _graceTimer.Elapsed += GraceTimer_Elapsed; _warningTimer = new Countdown(); _warningTimer.Elapsed += WarningTimer_Elapsed; _cooldownTimer = new Countdown(); _cooldownTimer.Elapsed += CooldownTimer_Elapsed; _vitalTimer = new Countdown(); _vitalTimer.Elapsed += VitalTimer_Elapsed; Hook += SelfHook; }