Beispiel #1
0
 internal Operation(
     [NotNull] Func <CancellationToken, Task <TResult> > expression,
     [CanBeNull] OperationNotificationBase notification,
     [CanBeNull] OperationConditionBase condition)
 {
     _expression  = expression;
     Notification = notification;
     Condition    = condition;
 }
Beispiel #2
0
        private void RequestShowNotification([NotNull] OperationNotificationBase notification)
        {
            var notificationType = notification.GetType();

            _notificationsCounter.TryGetValue(notificationType, out var counter);
            _notificationsCounter[notificationType] = ++counter;

            notification.Show(this);
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        public IOperationBuilder WithNotification(OperationNotificationBase notification)
        {
            _notification = notification;

            return(this);
        }