generic class and IList

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

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