generic class and IList

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I have made a class that uses the IList interface but I want the interface
implementations to be strongly typed. Right now its asking me to implement
functions like Add(Object) when I want it to be Add(MyType). The Collections
in Avalon do this, I'm curious how I could setup a class in such a way.

Jason
 
Jason,

Before .NET 2.0, you can not, because you would have to parameterize
your type, which is only supported through Generics in 2.0.

Hope this helps.
 
Back
Top