protected virtual void PublicationFilter(LocalPublicationFilterEventArgs <TPayload> e) { e.EnsureNotNull(nameof(e)); // if (TryReadDA(location: ref _activatedSubscription, considerDisposeRequest: true, result: out var activatedSubscription)) { e.Cancel = !ReferenceEquals(e.Subscription, activatedSubscription); }
void ILocalPublicationFilterListener.PublicationFilter(object sender, LocalPublicationFilterEventArgs eventArgs) { eventArgs.EnsureNotNull(nameof(eventArgs)); // var msg = eventArgs.Message as ILocalMessage <TPayload>; if (msg is null) { eventArgs.Cancel = true; } else { var locEventArgs = new LocalPublicationFilterEventArgs <TPayload>(subscription: eventArgs.Subscription, message: msg); PublicationFilter(locEventArgs); eventArgs.Cancel = locEventArgs.OnceCanceled; } }