protected override void DoChargeWork() { for (;;) { Thread.Sleep(ChargeEllapsedTime); StartStopChargeEvent.WaitOne(); IncreaseCharge(); } }
protected override async void DoChargeWork() { for (;;) { await Task.Delay(ChargeEllapsedTime); StartStopChargeEvent.WaitOne(); IncreaseCharge(); } }