/// <summary> /// Removes a publication from the topic. /// </summary> /// <param name="publisher">The object that contains the publication.</param> /// <param name="eventInfo">The event on the publisher that fires the topic.</param> public void RemovePublication(object publisher, EventInfo eventInfo) { this.Clean(); IPublication publication = this.FindPublication(publisher, eventInfo.Name); if (publication != null) { lock (this) { List <IPublication> newPublications = new List <IPublication>(); foreach (IPublication p in this.publications) { if (p != publication) { newPublications.Add(p); } } publication.Dispose(); this.publications = newPublications; this.extensionHost.ForEach(extension => extension.RemovedPublication(this, publication)); } } }
public void RemovePublication(string topic, object publisher, string eventName) { IEventTopic eventTopic = this.eventTopicHost.GetEventTopic(topic); IPublication publication = eventTopic.RemovePublication(publisher, eventName); if (publication != null) { publication.Dispose(); } }
private void UnregisterPropertyPublications(object publisher, IEnumerable <PropertyPublicationScanResult> propertyPublications) { foreach (PropertyPublicationScanResult propertyPublication in propertyPublications) { IEventTopic topic = this.eventTopicHost.GetEventTopic(propertyPublication.Topic); IPublication publication = topic.RemovePublication(publisher, propertyPublication.Event.Name); if (publication != null) { publication.Dispose(); } } }