Lines Matching defs:item
298 $"Cannot set Capacity to a value smaller than the current item count, {count}");
331 /// Adds the specified item to the collection.
333 /// <param name="item">The item to add.</param>
334 public void Add(T item)
336 ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item));
338 array[count++] = item;
351 /// Determines whether this collection contains the given item.
353 /// <param name="item">The item to find.</param>
354 /// <returns><c>true</c> if this collection contains the given item; <c>false</c> otherwise.</returns>
355 public bool Contains(T item)
357 return IndexOf(item) != -1;
371 /// Removes the specified item from the collection
373 /// <param name="item">The item to remove.</param>
374 /// <returns><c>true</c> if the item was found and removed; <c>false</c> otherwise.</returns>
375 public bool Remove(T item)
377 int index = IndexOf(item);
433 foreach (var item in collection)
435 if (item == null)
451 foreach (T item in values)
453 Add(item);
553 /// Returns the index of the given item within the collection, or -1 if the item is not
556 /// <param name="item">The item to find in the collection.</param>
557 /// <returns>The zero-based index of the item, or -1 if it is not found.</returns>
558 public int IndexOf(T item)
560 ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item));
564 if (comparer.Equals(array[i], item))
573 /// Inserts the given item at the specified index.
575 /// <param name="index">The index at which to insert the item.</param>
576 /// <param name="item">The item to insert.</param>
577 public void Insert(int index, T item)
579 ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item));
586 array[index] = item;
591 /// Removes the item at the given index.
593 /// <param name="index">The zero-based index of the item to remove.</param>
617 /// Gets or sets the item at the specified index.
623 /// <returns>The item at the specified index.</returns>