CollectionBaseTAdd Method |
Namespace: X3Platform.Collections
Exception | Condition |
---|---|
NotImplementedException | Always throws this exception to indicated that the method must be overridden or re-implemented in the derived class. |
This method is not abstract, although derived classes should always override it. It is not abstract because some derived classes may wish to reimplement Add with a different return type (typically bool). In C#, this can be accomplished with code like the following:
public class MyCollection<T>: CollectionBase<T>, ICollection<T> { public new bool Add(T item) { /* Add the item */ } void ICollection<T>.Add(T item) { Add(item); } }