Can I generate switch cases at compile time?

Have a look here : Creating switch cases programmatically - #2 by ScottRedig