public void RequestCancelConfirmation() { var e = new ConfirmationRequestedEventArgs("Czy na pewno przerwać?"); this.OnConfirmationRequested(e); this.IsCancelRequested = false; if (e.IsAccepted.HasValue && e.IsAccepted.Value == true) { this._cancellationTokenSource.Cancel(); throw new Exception("Przerwano operację."); } }
protected virtual void OnConfirmationRequested(ConfirmationRequestedEventArgs e) => this.CancelConfirmationRequested?.Invoke(this, e);