Here's a contrived example of a string literal switch statement:
static string GetStuff(string key)
{
switch (key)
{
case "thing1": return "oh no";
case "thing2": return "oh yes";
case "cat": return "in a hat";
case "wocket": return "in my pocket";
case "redFish": return "blue fish";
case "oneFish": return "two fish";
default: throw new NotImplementedException("The key '" + key + "' does not exist, go ask your Dad");
}
}
You get the idea.
What I'd love to do is print each of the literal strings for each of the cases via reflection.
I've not done enough with reflection to know how to do it intuitively. I'm honestly not sure if reflection can do this kind of thing at all.
Can it be done? If so, how?