示例#1
0
        public static ICollection <TKey> get_Keys <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary)
#pragma warning restore IDE1006 // Naming Styles
#pragma warning restore SA1300  // Element should begin with upper-case letter
#pragma warning restore CA1707  // Identifiers should not contain underscores
        {
            ConcurrentCollectionHelper.Interleave();
            return(concurrentDictionary.Keys);
        }
#pragma warning disable CA1707  // Identifiers should not contain underscores
#pragma warning disable SA1300  // Element should begin with upper-case letter
#pragma warning disable IDE1006 // Naming Styles
        public static bool get_IsEmpty <T>(ConcurrentQueue <T> concurrentQueue)
#pragma warning restore IDE1006 // Naming Styles
#pragma warning restore SA1300  // Element should begin with upper-case letter
#pragma warning restore CA1707  // Identifiers should not contain underscores
        {
            ConcurrentCollectionHelper.Interleave();
            return(concurrentQueue.IsEmpty);
        }
示例#3
0
#pragma warning disable CA1707  // Identifiers should not contain underscores
#pragma warning disable SA1300  // Element should begin with upper-case letter
#pragma warning disable IDE1006 // Naming Styles
        public static int get_Count <T>(ConcurrentStack <T> concurrentStack)
#pragma warning restore IDE1006 // Naming Styles
#pragma warning restore SA1300  // Element should begin with upper-case letter
#pragma warning restore CA1707  // Identifiers should not contain underscores
        {
            ConcurrentCollectionHelper.Interleave();
            return(concurrentStack.Count);
        }
示例#4
0
#pragma warning disable CA1707  // Identifiers should not contain underscores
#pragma warning disable SA1300  // Element should begin with upper-case letter
#pragma warning disable IDE1006 // Naming Styles
        public static void set_Item <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary, TKey key, TValue value)
#pragma warning restore IDE1006 // Naming Styles
#pragma warning restore SA1300  // Element should begin with upper-case letter
#pragma warning restore CA1707  // Identifiers should not contain underscores
        {
            ConcurrentCollectionHelper.Interleave();
            concurrentDictionary[key] = value;
        }
示例#5
0
 public static void Clear <T>(ConcurrentBag <T> concurrentBag)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentBag.Clear();
 }
 public static IEnumerator <T> GetEnumerator <T>(ConcurrentQueue <T> concurrentQueue)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentQueue.GetEnumerator());
 }
 public static void CopyTo <T>(ConcurrentQueue <T> concurrentQueue, T[] array, int index)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentQueue.CopyTo(array, index);
 }
示例#8
0
 public static bool TryUpdate <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary, TKey key, TValue newValue, TValue comparisonValue)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.TryUpdate(key, newValue, comparisonValue));
 }
示例#9
0
 public static bool TryRemove <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary, TKey key, out TValue value)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.TryRemove(key, out value));
 }
示例#10
0
 public static void Clear <T>(ConcurrentStack <T> concurrentStack)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentStack.Clear();
 }
示例#11
0
 public static int TryPopRange <T>(ConcurrentStack <T> concurrenStack, T[] items)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrenStack.TryPopRange(items));
 }
示例#12
0
 public static int TryPopRange <T>(ConcurrentStack <T> concurrenStack, T[] items, int startIndex, int count)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrenStack.TryPopRange(items, startIndex, count));
 }
示例#13
0
 public static bool TryPop <T>(ConcurrentStack <T> concurrentStack, out T result)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentStack.TryPop(out result));
 }
示例#14
0
 public static T[] ToArray <T>(ConcurrentStack <T> concurrentStack)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentStack.ToArray());
 }
示例#15
0
 public static void PushRange <T>(ConcurrentStack <T> concurrentStack, T[] items, int startIndex, int count)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentStack.PushRange(items, startIndex, count);
 }
示例#16
0
 public static TValue GetOrAdd <TKey, TArg, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary, TKey key, Func <TKey, TArg, TValue> valueFactory,
                                                    TArg factoryArgument)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.GetOrAdd(key, valueFactory, factoryArgument));
 }
示例#17
0
 public static KeyValuePair <TKey, TValue>[] ToArray <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.ToArray());
 }
示例#18
0
 public static void Push <T>(ConcurrentStack <T> concurrentStack, T item)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentStack.Push(item);
 }
示例#19
0
 public static bool TryRemove <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary, KeyValuePair <TKey, TValue> item)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.TryRemove(item));
 }
示例#20
0
 public static void PushRange <T>(ConcurrentStack <T> concurrentStack, T[] items)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentStack.PushRange(items);
 }
示例#21
0
 public static TValue AddOrUpdate <TKey, TArg, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary, TKey key, Func <TKey, TArg, TValue> addValueFactory,
                                                       Func <TKey, TValue, TArg, TValue> updateValueFactory, TArg factoryArgument)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.AddOrUpdate(key, addValueFactory, updateValueFactory, factoryArgument));
 }
示例#22
0
 public static void Clear <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentDictionary.Clear();
 }
示例#23
0
 public static bool TryPeek <T>(ConcurrentQueue <T> concurrentQueue, out T result)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentQueue.TryPeek(out result));
 }
示例#24
0
 public static bool ContainsKey <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary, TKey key)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.ContainsKey(key));
 }
示例#25
0
 public static void Clear <T>(ConcurrentQueue <T> concurrentQueue)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentQueue.Clear();
 }
示例#26
0
 public static IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.GetEnumerator());
 }
示例#27
0
 public static void Enqueue <T>(ConcurrentQueue <T> concurrentQueue, T item)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentQueue.Enqueue(item);
 }
示例#28
0
 public static TValue GetOrAdd <TKey, TValue>(ConcurrentDictionary <TKey, TValue> concurrentDictionary, TKey key, TValue value)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentDictionary.GetOrAdd(key, value));
 }
示例#29
0
 public static T[] ToArray <T>(ConcurrentQueue <T> concurrentQueue)
 {
     ConcurrentCollectionHelper.Interleave();
     return(concurrentQueue.ToArray());
 }
示例#30
0
 public static void Add <T>(ConcurrentBag <T> concurrentBag, T item)
 {
     ConcurrentCollectionHelper.Interleave();
     concurrentBag.Add(item);
 }