Lines Matching defs:index
364 /// <param name="arrayIndex">The first index of the array to copy to.</param>
377 int index = IndexOf(item);
378 if (index == -1)
382 Array.Copy(array, index + 1, array, index, count - index - 1);
553 /// Returns the index of the given item within the collection, or -1 if the item is not
557 /// <returns>The zero-based index of the item, or -1 if it is not found.</returns>
573 /// Inserts the given item at the specified index.
575 /// <param name="index">The index at which to insert the item.</param>
577 public void Insert(int index, T item)
580 if (index < 0 || index > count)
582 throw new ArgumentOutOfRangeException(nameof(index));
585 Array.Copy(array, index, array, index + 1, count - index);
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>
594 public void RemoveAt(int index)
596 if (index < 0 || index >= count)
598 throw new ArgumentOutOfRangeException(nameof(index));
600 Array.Copy(array, index + 1, array, index, count - index - 1);
617 /// Gets or sets the item at the specified index.
620 /// The element at the specified index.
622 /// <param name="index">The zero-based index of the element to get or set.</param>
623 /// <returns>The item at the specified index.</returns>
624 public T this[int index]
628 if (index < 0 || index >= count)
630 throw new ArgumentOutOfRangeException(nameof(index));
632 return array[index];
636 if (index < 0 || index >= count)
638 throw new ArgumentOutOfRangeException(nameof(index));
641 array[index] = value;
648 void ICollection.CopyTo(Array array, int index)
650 Array.Copy(this.array, 0, array, index, count);
657 object IList.this[int index]
659 get { return this[index]; }
660 set { this[index] = (T)value; }
683 void IList.Insert(int index, object value)
685 Insert(index, (T) value);