public async Task <bool> HandlePause() { var ret = false; while (IsPaused != null && IsPaused.Invoke()) { ret = true; await Task.Yield(); } return(ret); }
protected virtual void OnIsPaused(EventArgs e) { IsPaused?.Invoke(this, isPaused); }