Problem:
I want to extend a few of the properties on the SystemCollections.Generic.List however I am not sure how to inherit from that object. Please help.
Solution:
System.Collections.Generic.List is a generic collection that does not contain any virtual members. This was designed for performance not for inheritance. So this can't inherit.
The following generic collections are designed for inheritance and should be exposed instead of System.Collections.Generic.List.
I want to extend a few of the properties on the SystemCollections.Generic.List however I am not sure how to inherit from that object. Please help.
Solution:
System.Collections.Generic.List is a generic collection that does not contain any virtual members. This was designed for performance not for inheritance. So this can't inherit.
The following generic collections are designed for inheritance and should be exposed instead of System.Collections.Generic.List.
- System.Collections.ObjectModel.Collection
- System.Collections.ObjectModel.ReadOnlyCollection
- System.Collections.ObjectModel.KeyedCollection
No comments:
Post a Comment