G
Girish
How do i populate a static hastable without the need to instantiate the
class? any ideas? Im confused.
class VAErrorMap
{
static Hasttable _ErrorMap = new Hashtable();
public VAErrorMap()
{
//populate has here.. but dont want to!
_ErrorMap.Add(1, "error in user input");
_ErrorMap.Add(2, "error in input file");
//etc etc
}
}
Im trying to figure out a way to populate the variable in class scope so i
dont have to instantiate it. The other way would be a singleton - but i dont
want to do this as a sigleton. I cant think of another way.. maybe its
simple and Im just overlooking something.
Thanks,
Girish
class? any ideas? Im confused.
class VAErrorMap
{
static Hasttable _ErrorMap = new Hashtable();
public VAErrorMap()
{
//populate has here.. but dont want to!
_ErrorMap.Add(1, "error in user input");
_ErrorMap.Add(2, "error in input file");
//etc etc
}
}
Im trying to figure out a way to populate the variable in class scope so i
dont have to instantiate it. The other way would be a singleton - but i dont
want to do this as a sigleton. I cant think of another way.. maybe its
simple and Im just overlooking something.
Thanks,
Girish