System.Collections.Generic.List (v2.0)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've noticed that in VS.NET 2.0 Beta 1 that none of the methods in
System.Collections.Generic.List are overridable. In my app I currently have
over 50 strongly typed ArrayLists that inherit from
System.Collections.ArrayList. Each of these types raise strongly typed
events for when items are added and removed (e.g., AddingItem, AddedItem,
CollectionChanged, etc.). One of my hopes for v2.0 was to create a single
generic List that replaces all of my current ArrayLists. But, if methods in
System.Collections.Generic.List are not overridable then I won't be able to
insert the necessary code for raising the events. Note that shadowing the
necessary methods is not safe because code that is executed outside of my
application will not call the shadowed methods (e.g., when the List is being
edited by a PropertyGrid).

Can somebody tell me if methods in System.Collections.Generic.List are
expected to be overridable in the final version of VS.NET 2.0 as they are in
System.Collections.ArrayList?

Thanks,
Lance
 
Can somebody tell me if methods in System.Collections.Generic.List are
expected to be overridable in the final version of VS.NET 2.0 as they are in
System.Collections.ArrayList?

No.

But you can still write a generic class that implements IList(Of T)
and uses List(Of T) internally for storage.



Mattias
 

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

Back
Top