internal Operation( [NotNull] Func <CancellationToken, Task <TResult> > expression, [CanBeNull] OperationNotificationBase notification, [CanBeNull] OperationConditionBase condition) { _expression = expression; Notification = notification; Condition = condition; }
private void RequestShowNotification([NotNull] OperationNotificationBase notification) { var notificationType = notification.GetType(); _notificationsCounter.TryGetValue(notificationType, out var counter); _notificationsCounter[notificationType] = ++counter; notification.Show(this); }
private void RequestHideNotification([NotNull] OperationNotificationBase notification, OperationCallback callback) { var notificationType = notification.GetType(); _notificationsCounter.TryGetValue(notificationType, out var counter); _notificationsCounter[notificationType] = Math.Max(--counter, 0); if (counter == 0) { notification.Hide(this, callback); } }
public IOperationBuilder WithNotification(OperationNotificationBase notification) { _notification = notification; return(this); }