How to access static member??
-
I have a list definition,
public class List { private int index; private string name; }
and a tablepublic class Table { public static List List1 = new List(1,"List1"); public static List List2 = new List(2,"List2"); ... }
Now , if I want to add a method of Tablepublic class Table { public static List GetListFromIndex( int index){...} }
How can I avoid a lot of "switch case"???? Thanks!. I know this maybe related to "reflection" , but cannot figure it out. -
I have a list definition,
public class List { private int index; private string name; }
and a tablepublic class Table { public static List List1 = new List(1,"List1"); public static List List2 = new List(2,"List2"); ... }
Now , if I want to add a method of Tablepublic class Table { public static List GetListFromIndex( int index){...} }
How can I avoid a lot of "switch case"???? Thanks!. I know this maybe related to "reflection" , but cannot figure it out.I don't know background so I must ask, why you dont use standard
Array(List)
of strings? :confused: I mean (example),public class Table { static ArrayList list; public static string GetListFromIndex(int i){return (string)list[i];} }
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy