Pleas help - collection property indexer worries...

A

almurph

Hi,


Hope that you can help me please. I'm trying to implement a simple
collection property using ArrayList as an indexer. i want this to be
pretty generic
However I'm having difficulty with the conversions. I know that
System.Collection.ArrayList accepts and returns most of it's members as
objects but it's giving an error message of:

"Cannot implicitly convert type 'string' to
'System.Collections.ArrayList

Can anyone please help me please?

Thanks,
al


***** CODE AS FOLLOWS *****

public class collExample
{

private System.Collections.ArrayList AL = new
System.Collections.ArrayList();

public System.Collections.ArrayList this[int idx]
{
get
{
return AL[idx];
}
set
{
AL[idx] = value;
}
}

}// end collExample
 

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