using System.Reflection;
public class ConstCollection:Dictionary<MyConst,string>
{
public string A="a";
public string B="b";
public ConstCollection(){
foreach (MyConst c in Enum.GetValues(typeof(MyConst))){
MethodInfo m = this.GetType().GetMethod(c.ToString());
if(m!=null){
string cValue=(string)m.Invoke(this, null);
this.add(c,cValue);
}
}
}
}
public enum MyConst{
A,
B,
C
}