Exemplo n.º 1
0
        public bool PublishCancelable(ICancelableNotification notification)
        {
            if (notification == null)
            {
                throw new ArgumentNullException(nameof(notification));
            }

            if (_isSuppressed)
            {
                return(false);
            }

            _eventAggregator.Publish(notification);
            return(notification.Cancel);
        }
Exemplo n.º 2
0
        public async Task <bool> PublishCancelableAsync(ICancelableNotification notification)
        {
            if (notification == null)
            {
                throw new ArgumentNullException(nameof(notification));
            }

            if (_isSuppressed)
            {
                return(false);
            }

            await _eventAggregator.PublishAsync(notification);

            return(notification.Cancel);
        }