From 4aa76bd647437096f3ed78ebf7f0224d20ce1084 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Mon, 26 Oct 2020 11:48:24 -0400 Subject: [PATCH] test: Added count to collection debugger displays --- ICD.Common.Utils/Collections/BiDictionary.cs | 6 ++++++ ICD.Common.Utils/Collections/IcdHashSet.cs | 6 ++++++ ICD.Common.Utils/Collections/IcdOrderedDictionary.cs | 6 ++++++ ICD.Common.Utils/Collections/PriorityQueue.cs | 6 ++++++ ICD.Common.Utils/Collections/RateLimitedEventQueue.cs | 6 ++++++ ICD.Common.Utils/Collections/ScrollQueue.cs | 6 ++++++ ICD.Common.Utils/Collections/WeakKeyDictionary.cs | 6 ++++++ 7 files changed, 42 insertions(+) diff --git a/ICD.Common.Utils/Collections/BiDictionary.cs b/ICD.Common.Utils/Collections/BiDictionary.cs index 60e3823..a5500dc 100644 --- a/ICD.Common.Utils/Collections/BiDictionary.cs +++ b/ICD.Common.Utils/Collections/BiDictionary.cs @@ -2,6 +2,9 @@ using System.Collections; using System.Collections.Generic; using ICD.Common.Properties; +#if !SIMPLSHARP +using System.Diagnostics; +#endif namespace ICD.Common.Utils.Collections { @@ -10,6 +13,9 @@ namespace ICD.Common.Utils.Collections /// /// /// +#if !SIMPLSHARP + [DebuggerDisplay("Count = {Count}")] +#endif public sealed class BiDictionary : IDictionary { private readonly Dictionary m_KeyToValue; diff --git a/ICD.Common.Utils/Collections/IcdHashSet.cs b/ICD.Common.Utils/Collections/IcdHashSet.cs index af85962..6c49d47 100644 --- a/ICD.Common.Utils/Collections/IcdHashSet.cs +++ b/ICD.Common.Utils/Collections/IcdHashSet.cs @@ -4,6 +4,9 @@ using System.Collections.Generic; using System.Linq; using ICD.Common.Properties; using ICD.Common.Utils.Extensions; +#if !SIMPLSHARP +using System.Diagnostics; +#endif namespace ICD.Common.Utils.Collections { @@ -11,6 +14,9 @@ namespace ICD.Common.Utils.Collections /// A collection containing only unique items. /// /// +#if !SIMPLSHARP + [DebuggerDisplay("Count = {Count}")] +#endif public sealed class IcdHashSet : ICollection { private readonly Dictionary m_Dict; diff --git a/ICD.Common.Utils/Collections/IcdOrderedDictionary.cs b/ICD.Common.Utils/Collections/IcdOrderedDictionary.cs index f02f894..edaa41c 100644 --- a/ICD.Common.Utils/Collections/IcdOrderedDictionary.cs +++ b/ICD.Common.Utils/Collections/IcdOrderedDictionary.cs @@ -4,9 +4,15 @@ using System.Collections.Generic; using System.Linq; using ICD.Common.Properties; using ICD.Common.Utils.Extensions; +#if !SIMPLSHARP +using System.Diagnostics; +#endif namespace ICD.Common.Utils.Collections { +#if !SIMPLSHARP + [DebuggerDisplay("Count = {Count}")] +#endif public sealed class IcdOrderedDictionary : IDictionary { private readonly List m_OrderedKeys; diff --git a/ICD.Common.Utils/Collections/PriorityQueue.cs b/ICD.Common.Utils/Collections/PriorityQueue.cs index 2143ae7..d7f9635 100644 --- a/ICD.Common.Utils/Collections/PriorityQueue.cs +++ b/ICD.Common.Utils/Collections/PriorityQueue.cs @@ -4,12 +4,18 @@ using System.Collections.Generic; using System.Linq; using ICD.Common.Properties; using ICD.Common.Utils.Extensions; +#if !SIMPLSHARP +using System.Diagnostics; +#endif namespace ICD.Common.Utils.Collections { /// /// Provides a first-in first-out collection with enhanced insertion features. /// +#if !SIMPLSHARP + [DebuggerDisplay("Count = {Count}")] +#endif public sealed class PriorityQueue : IEnumerable, ICollection { private readonly IcdOrderedDictionary> m_PriorityToQueue; diff --git a/ICD.Common.Utils/Collections/RateLimitedEventQueue.cs b/ICD.Common.Utils/Collections/RateLimitedEventQueue.cs index b3cc5bb..15f7976 100644 --- a/ICD.Common.Utils/Collections/RateLimitedEventQueue.cs +++ b/ICD.Common.Utils/Collections/RateLimitedEventQueue.cs @@ -5,12 +5,18 @@ using ICD.Common.Properties; using ICD.Common.Utils.EventArguments; using ICD.Common.Utils.Extensions; using ICD.Common.Utils.Timers; +#if !SIMPLSHARP +using System.Diagnostics; +#endif namespace ICD.Common.Utils.Collections { /// /// RateLimitedEventQueue provides features for enqueing items to be raised via an event at a controlled interval. /// +#if !SIMPLSHARP + [DebuggerDisplay("Count = {Count}")] +#endif public sealed class RateLimitedEventQueue : IEnumerable, ICollection, IDisposable { /// diff --git a/ICD.Common.Utils/Collections/ScrollQueue.cs b/ICD.Common.Utils/Collections/ScrollQueue.cs index 8f589a9..7956608 100644 --- a/ICD.Common.Utils/Collections/ScrollQueue.cs +++ b/ICD.Common.Utils/Collections/ScrollQueue.cs @@ -2,6 +2,9 @@ using System.Collections; using System.Collections.Generic; using ICD.Common.Properties; +#if !SIMPLSHARP +using System.Diagnostics; +#endif namespace ICD.Common.Utils.Collections { @@ -10,6 +13,9 @@ namespace ICD.Common.Utils.Collections /// are removed as new items are added. /// /// +#if !SIMPLSHARP + [DebuggerDisplay("Count = {Count}")] +#endif public sealed class ScrollQueue : IEnumerable, ICollection { private readonly LinkedList m_Collection; diff --git a/ICD.Common.Utils/Collections/WeakKeyDictionary.cs b/ICD.Common.Utils/Collections/WeakKeyDictionary.cs index 402718c..8498098 100644 --- a/ICD.Common.Utils/Collections/WeakKeyDictionary.cs +++ b/ICD.Common.Utils/Collections/WeakKeyDictionary.cs @@ -4,6 +4,9 @@ using System.Collections.Generic; using System.Linq; using ICD.Common.Properties; using ICD.Common.Utils.Extensions; +#if !SIMPLSHARP +using System.Diagnostics; +#endif namespace ICD.Common.Utils.Collections { @@ -108,6 +111,9 @@ namespace ICD.Common.Utils.Collections /// /// /// +#if !SIMPLSHARP + [DebuggerDisplay("Count = {Count}")] +#endif public sealed class WeakKeyDictionary : IDictionary { private readonly Dictionary, TValue> m_Dictionary;