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

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

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

            return(this);
        }