Exemplo n.º 1
0
        public QueueModel(MessageQueue queue)
            : this()
        {
            this.path = queue.Path;
            this.Name = GetFriendlyName(queue);
            List<QueueModel> subqueues = new List<QueueModel>();
            if (queue.GetNumberOfSubqueues() > 0)
            {
                foreach (string subQueueName in queue.GetSubqueueNames())
                {
                    subqueues.Add(new QueueModel(queue, subQueueName));
                }
            }

            this.SubQueues = subqueues;
        }
Exemplo n.º 2
0
        private IEnumerable<MessageQueue> GetQueueWithSubQueues(MessageQueue queue)
        {
            if (this.ShowOnlyNonempty && queue.GetNumberOfMessages() == 0)
            {
                yield break;
            }

            yield return queue;

            if (queue.GetNumberOfSubqueues() > 0)
            {
                foreach (string subQueueName in queue.GetSubqueueNames())
                {
                    using (MessageQueue subQueue = new MessageQueue(queue.Path + ";" + subQueueName))
                    {
                        yield return subQueue;
                    }
                }
            }
        }