Exemple #1
0
        /// <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));
                }
            }
        }
Exemple #2
0
        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();
            }
        }
Exemple #3
0
        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();
                }
            }
        }