Returns error information, resulting from trying to query a queue for status information
Inheritance: IQueueInformation
コード例 #1
0
 public void Create(string name, string server, Exception error)
 {
     IQueueInformation test = new QueueInformationError(name, server, error);
     Assert.Equal(name, test.Name);
     Assert.Equal(server, test.Server);
     Assert.Equal(DateTime.MinValue, test.CurentDateTime);
     Assert.Equal(string.Empty, test.DateTimeProvider);
     Assert.Equal(1, test.Data.Count());
     var systemEntries = test.Data.ToList();
     Assert.Contains(error.ToString(), systemEntries[0].Value);
     Assert.Contains("Error", systemEntries[0].Name);
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueStatus"/> class.
 /// </summary>
 /// <param name="providers">The providers.</param>
 public QueueStatus(IEnumerable<IQueueStatusProvider> providers)
 {
     var statues = new ConcurrentBag<IQueueInformation>();
     Parallel.ForEach(providers, provider =>
     {
         IQueueInformation current;
         try
         {
             current = provider.Current;
         }
         catch (Exception error)
         {
             current = new QueueInformationError(provider.Name, provider.Server, error);
         }
         if (current != null)
         {
             statues.Add(current);
         }
     });
     Queues = statues.ToList();
 }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueStatus"/> class.
        /// </summary>
        /// <param name="providers">The providers.</param>
        public QueueStatus(IEnumerable <IQueueStatusProvider> providers)
        {
            var statues = new ConcurrentBag <IQueueInformation>();

            Parallel.ForEach(providers, provider =>
            {
                IQueueInformation current;
                try
                {
                    current = provider.Current;
                }
                catch (Exception error)
                {
                    current = new QueueInformationError(provider.Name, provider.Server, error);
                }
                if (current != null)
                {
                    statues.Add(current);
                }
            });
            Queues = statues.ToList();
        }