"Michael Primeaux" <mj********@msn.com> wrote:
Why does the generic SortedList and generic SortedDictionary not define any
virtual members?
The classes in the System.Collections.Generics namespace are designed to
be efficient for users who need them to be efficient. Non-virtual
methods are easier to inline (usually it is impossible to inline virtual
method calls) and are faster to call (less indirections are needed).
It's generally recommended that you use composition rather than
inheritance to get extra collection behaviours. You can still implement
IDictionary, IList and friends to support polymorphic behaviour where
required.
System.Collections.ObjectModel has some containers more suitable for
inheritance.
-- Barry