Collection<T> RemoveAt vs RemoveItem
Reason for having two methods is to allow consumer to create subclass of Collection<T>
that will override behavior of inserting\removing items. You can override InsertItem
, RemoveItem
, SetItem
, ClearItems
.
For example, you can override this methods in subclass to send events (like ObservableCollection) or to log any collection change.
The documentation for RemoveAt
includes this interesting note at the bottom of the page:
Derived classes can override RemoveItem(Int32) to change the behavior of this method.
The ultimate conclusion is that RemoveAt
calls RemoveItem
, and that derived classes override the behavior by overriding RemoveItem
.