Capture list item events in list class

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?
 
J

justageezer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top