/// <summary> /// Removes the range. /// <locDE><para />Bereich (die angegebenen Elemente) entfernen.</locDE> /// </summary> /// <typeparam name="T">The type of the T.<locDE><para />Generischer Datentyp T.</locDE></typeparam> /// <param name="items">The items.<locDE><para />Die Elemente.</locDE></param> /// <param name="collection">The collection of items to remove.<locDE><para />Die Collection von zu entfernenden Elementen.</locDE></param> public static void RemoveRange <T>(this System.Collections.Generic.IList <T> items, System.Collections.Generic.IEnumerable <T> collection) { if (null == items || null == collection) { return; } // Remove range from local items // Den Bereich (die angegebenen Elemente) aus den lokalen Elementen entfernen collection.Apply(p => items.Remove(p)); }
public bool Remove(T item) { int idx = list.IndexOf(item); bool rtn = list.Remove(item); if (rtn) { System.ComponentModel.ListChangedEventArgs e = new System.ComponentModel.ListChangedEventArgs(System.ComponentModel.ListChangedType.ItemDeleted, -1, idx); OnListChanged(e); } return(rtn); }