PC Review


Reply
Thread Tools Rate Thread

Capture list item events in list class

 
 
justageezer
Guest
Posts: n/a
 
      20th Oct 2008
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?

 
Reply With Quote
 
 
 
 
justageezer
Guest
Posts: n/a
 
      20th Oct 2008
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.

"justageezer" wrote:

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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to capture events for next item Ashish Microsoft Outlook Program Addins 10 5th Feb 2010 07:38 AM
List and subtotal selected items, then print separate item list TitanG Microsoft Excel Worksheet Functions 0 8th Sep 2008 09:07 PM
adding another item to a list of fields coming from a table inside of a list control thread Microsoft Access 8 28th Feb 2007 07:06 PM
Casting List<> of derived class to List<> of base class? matty.hall@gmail.com Microsoft C# .NET 4 12th Sep 2005 04:46 AM
How to raise event in a List Item class and cause an event in the custom List class moondaddy Microsoft VB .NET 3 5th Apr 2005 07:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:58 PM.