/// <summary> /// Adds an item to the list. /// </summary> /// <param name="item">The object to add to the list.</param> public void Add(TData item) { ArgValidator.Create(item, "item").IsNotNull(); ArgValidator.ParentIsNull(item); this.list.Add(item); item.Parent = this.parent; }
/// <summary> /// Inserts an item to the list at the specified index. /// </summary> /// <param name="index">The zero-based index at which item should be inserted.</param> /// <param name="item">The object to insert into the list.</param> public void Insert(int index, TData item) { ArgValidator.Create(item, "item").IsNotNull(); ArgValidator.ParentIsNull(item); this.list.Insert(index, item); item.Parent = this.parent; }
/// <summary> /// Gets or sets the element at the specified index. /// </summary> /// <param name="index">The zero-based index of the element to get or set.</param> /// <returns>The element at the specified index.</returns> public TData this[int index] { get { return(this.list[index]); } set { ArgValidator.Create(value, "value").IsNotNull(); ArgValidator.ParentIsNull(value); this.list[index].Parent = null; this.list[index] = value; this.list[index].Parent = this.parent; } }