protected virtual void OnPublicationDisposed(IPublication publication) { if (publication.Publisher != this) { throw new ArgumentOutOfRangeException(nameof(publication)); } if (!PublicationsById.TryGetValue(publication.Id, out var p)) { return; } Publications.TryRemove(publication.State.Computed.Input, p); PublicationsById.TryRemove(p.Id, p); }
public virtual IPublication?TryGet(Symbol publicationId) => PublicationsById.TryGetValue(publicationId, out var p) ? p : null;