/// <summary> /// Adds the element to the end of the collection. /// </summary> /// <param name="item">The element to be added.</param> public void Add(OptionalContentGroupItem item) { if (item == null) { throw new ArgumentNullException(); } _items.Add(item); _array.AddItem(item.GetObject()); }
/// <summary> /// Inserts an element at the specified index to the collection. /// </summary> /// <param name="index" href="http://msdn.microsoft.com/en-us/library/system.int32.aspx">The zero-based index at which the element is to be inserted.</param> /// <param name="item">The element to insert.</param> public void Insert(int index, OptionalContentGroupItem item) { if (item == null) { throw new ArgumentNullException(); } if (index < 0 || index > Count) { throw new IndexOutOfRangeException(); } _items.Insert(index, item); _array.Insert(index, item.GetObject()); }