Collection.RemoveAt(Int32) Method vs Collection.RemoveItem(Int32)
What is the difference between these two methods? According to the docs RemoveItem is virtual and RemoveAt is not, and that is the only difference I can find.
The excerpted source code looks something like this
IList<T> items;
....
public void RemoveAt(int index) {
if( items.IsReadOnly) {
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_ReadOnlyCollection);
}
if (index < 0 || index >= items.Count) {
ThrowHelper.ThrowArgumentOutOfRangeException();
}
RemoveItem(index);
}
...
protected virtual void RemoveItem(int index) {
items.RemoveAt(index);
}
So my question more properly is why are there two very similar methods differing only by being virtual or not? What is the use case? Is this just historical cruft? What's the story?