I\'m using the following right now:
foreach (string file in files) { switch (filetype.Value) { case \"ReadFile\": ReadFile(file);
You could also use reflection (if you're okay with the different overhead that can bring) Check this solution
Hope that helped