I have a static Hashtable variable in a class that I would like to populate prior to any instance of the class being created. However, it seems like the earliest point at which I can populate the Hashtable is within the constructor.
I know Java allows a static code block...
Code
static {
// code here
}
...this allows for static code to occur prior to any object being created from the class. Is something like this possible in C#?? If not, does anyone have any suggestions on how to work around this?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
matadi4932 pointsPosted Apr 5, 2006, 5:06 AM EDT