public bool PublishCancelable(ICancelableNotification notification) { if (notification == null) { throw new ArgumentNullException(nameof(notification)); } if (_isSuppressed) { return(false); } _eventAggregator.Publish(notification); return(notification.Cancel); }
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); }