typed array list

Feb 17 2005 11:37 AM
i am trying to create aclass that will extends ArrayList and will be typed,like this: public class TypedArrayList : ArrayList { private Type data_type; public TypedArrayList(string type_name) { data_type = Type.GetType("Object"); data_type.GetType(); } public data_type this[int index] { get { return this[index]; } set { this[index] = value; } } } and i can't do you have any idea on how i can create one function that will return each time adifferent type like this: public data_type this[int index] when data_type can be changed. this way it doesn't work since the compiler says that data_type is a filed not a type itzik

Answers (3)