Reputation: 354654
I have used ObservableCollection<T>
in the past, but that seems to belong to WPF and therefore .NET 3.
And if there isn't what would be the appropriate interface for that? INotifyPropertyChanged
seems not to be a very good fit for collections, while INotifyCollectionChanged
is again only supported in .NET 3 and higher.
Upvotes: 4
Views: 1341
Reputation: 8424
All of the collections in the C5 Generic Collection Library are designed to be able to raise events when an item is added, inserted, removed, or when the collection is cleared or otherwise changed. It provides a more robust interface for dealing with these changes than being held strictly to a list of objects, but also works with dictionaries, hash tables, priority queues, persistently sorted lists, etc.
Upvotes: 0
Reputation: 27499
The Collection<T> exposes virtual InsertItem, RemoveItem, SetItem and ClearItems methods that you could override and add your own events triggers to.
(Just a possible alternative to the BindingList<T>)
Upvotes: 2