/// <summary> /// Removes the specified <see cref="Module"/> from the /// collection. /// </summary> /// <param name="value">The <see cref="Module"/> to remove from the collection.</param> public void Remove(Module value) { List.Remove(value); if (value.ModuleSet == _moduleSet) { value.ModuleSet = null; } }
/// <summary> /// Inserts a <see cref="Module" /> into the collection at the /// specified index. /// </summary> /// <param name="index">The zero-based index at which <paramref name="value"/> should be inserted.</param> /// <param name="value">The <see cref="Module"/> to insert.</param> public void Insert(int index, Module value) { if (value.ModuleSet != null) { throw new ArgumentException("Module is already linked to other ModuleSet."); } value.ModuleSet = _moduleSet; List.Insert(index, value); }
/// <summary> /// Determines whether a <see cref="Module"/> is in the collection. /// </summary> /// <param name="value">The <see cref="Module"/> to locate in the collection.</param> /// <returns> /// <see langword="true" /> if <paramref name="value" /> is found in the /// collection; otherwise, <see langword="false" />. /// </returns> public bool Contains(Module value) { return List.Contains(value); }
/// <summary> /// Gets the location of a <see cref="Module"/> in the collection. /// </summary> /// <param name="value">The <see cref="Module"/> object to locate.</param> /// <returns> /// The zero-based location of the <see cref="Module" /> in the /// collection. /// </returns> /// <remarks> /// If the <see cref="Module"/> is not currently a member of /// the collection, -1 is returned. /// </remarks> public int IndexOf(Module value) { return List.IndexOf(value); }
/// <summary> /// Adds a <see cref="Module"/> to the end of the collection. /// </summary> /// <param name="value">The <see cref="Module"/> to be added to the end of the collection.</param> /// <returns> /// The position into which the new item was inserted. /// </returns> public int Add(Module value) { if (value.ModuleSet != null) { throw new ArgumentException("Module is already linked to other ModuleSet."); } value.ModuleSet = _moduleSet; return List.Add(value); }