Exemplo n.º 1
0
        /// <summary>
        /// Gets a value that indicates whether the concurrent bag is empty.
        /// </summary>
#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(SystemConcurrent.ConcurrentBag <T> concurrentBag)
#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
        {
            Helper.Interleave();
            return(concurrentBag.IsEmpty);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Tries to return an object from the beginning of the concurrent bag without removing it.
 /// </summary>
 public static bool TryPeek(SystemConcurrent.ConcurrentBag <T> concurrentBag, out T result)
 {
     Helper.Interleave();
     return(concurrentBag.TryPeek(out result));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Copies the elements stored in the concurrent bag to a new array.
 /// </summary>
 public static T[] ToArray(SystemConcurrent.ConcurrentBag <T> concurrentBag)
 {
     Helper.Interleave();
     return(concurrentBag.ToArray());
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns an enumerator that iterates through the  concurrent bag.
 /// </summary>
 public static SystemGenerics.IEnumerator <T> GetEnumerator(SystemConcurrent.ConcurrentBag <T> concurrentBag)
 {
     Helper.Interleave();
     return(concurrentBag.GetEnumerator());
 }
Exemplo n.º 5
0
 /// <summary>
 /// Copies the concurrent bag elements to an existing one-dimensional array,
 /// starting at the specified array index.
 /// </summary>
 public static void CopyTo(SystemConcurrent.ConcurrentBag <T> concurrentBag, T[] array, int index)
 {
     Helper.Interleave();
     concurrentBag.CopyTo(array, index);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Removes all objects from the concurrent bag.
 /// </summary>
 public static void Clear(SystemConcurrent.ConcurrentBag <T> concurrentBag)
 {
     Helper.Interleave();
     concurrentBag.Clear();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Adds an object to the concurrent bag.
 /// </summary>
 public static void Add(SystemConcurrent.ConcurrentBag <T> concurrentBag, T item)
 {
     Helper.Interleave();
     concurrentBag.Add(item);
 }