Capture list item events in list class

  • Thread starter Thread starter justageezer
  • Start date Start date
J

justageezer

I feel I'm maybe barking up the wrong tree here, but can I write a collection
class (inheriting from collections.generic.list or similar) that can capture
events thrown by the list items? E.g:

Class Foo
Public Event MyEvent(sender as object, e as eventargs)
End Class

Class FooList
Inherits List(Of Foo)

Public Sub Handler(sender as object, e as event args) Handles
ListItems.MyEvent
End Sub

End Class

Any ideas?
 
I think I may have sussed it; shadow the collection modifier methods in the
base class and use AddHandler to assign my handler to each list items event.
 
Back
Top