Follow @RoyOsherove on Twitter

Implementing CollectionBase the right way

Matt Berther (The "other" ISerializable...) writes a nice little tidbit about correctly deriving from CollectionBase and adds something I was not aware of:
you really really want to override the OnValidate() event of CollectionBase so that you can validate objects before being added to the collection. This is crucial when someone casts your collection to an IList interface and then can have their way with your collection without your approval, unless you override this important method.
Thanks Matt.

See you at the .Net on the beach convention

Yukon "Query Notification": a life saver