/// <summary> /// Adds mutliple items to the collection. /// It's important to avoid locking for too long so an array is used to add multiple items. /// An enumerable is potentially slow as it may be yielding to a process. /// </summary> /// <param name="items">The items to add.</param> public virtual void Add(T[] items) { foreach (var i in items) { InternalSource.Add(i); } }
/// <inheritdoc cref="ICollection<T>" /> /// <param name="item1">First item to add.</param> /// <param name="item2">Additional item to add.</param> /// <param name="items">Extended param items to add.</param> public virtual void Add(T item1, T item2, params T[] items) { InternalSource.Add(item1); InternalSource.Add(item2); foreach (var i in items) { InternalSource.Add(i); } }
/// <inheritdoc /> public virtual void Add(T item) => InternalSource.Add(item);