Exemplo n.º 1
0
        /// <summary>
        /// Removes the topic from current PublisherClient publish list.
        /// </summary>
        /// <param name="topicName">Name of the topic.</param>
        /// <returns>Current PublisherClient.</returns>
        public PublisherClient RemoveTopic(string topicName = null)
        {
            this.CheckDisposed();

            ServiceBusManager.RemoveLinkPublisherTopic(this.Name, topicName);

            return(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Removes the publisher.
        /// </summary>
        /// <param name="publisherName">Name of the publisher.</param>
        /// <returns>Current Topic.</returns>
        public Topic RemovePublisher(string publisherName)
        {
            this.CheckDisposed();

            ServiceBusManager.RemoveLinkPublisherTopic(publisherName, this.Name);

            return(this);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Removes all topics from current PublisherClient publish list.
        /// </summary>
        /// <returns>Current PublisherClient.</returns>
        public PublisherClient RemoveAllTopics()
        {
            this.CheckDisposed();

            Dictionary <string, Topic> .KeyCollection topics = null;

            lock (Utilities.GetSyncRoot(this._topics))
            {
                topics = this._topics.Keys;
            }

            if (topics != null)
            {
                foreach (var topic in topics)
                {
                    ServiceBusManager.RemoveLinkPublisherTopic(this.Name, topic);
                }
            }

            return(this);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Removes all publishers.
        /// </summary>
        /// <returns>Current Topic.</returns>
        public Topic RemoveAllPublishers()
        {
            this.CheckDisposed();

            Dictionary <string, PublisherClient> .KeyCollection publishers = null;

            lock (Utilities.GetSyncRoot(this._publishers))
            {
                publishers = this._publishers.Keys;
            }

            if (publishers != null)
            {
                foreach (var publisher in publishers)
                {
                    ServiceBusManager.RemoveLinkPublisherTopic(publisher, this.Name);
                }
            }

            return(this);
        }