I am trying to dynamically set a resource string. The name of the resource varies slightly depending on a code that comes back from a web service. A different code should show a different message to the user.
Instead of a huge if structure, or a dictionary, is there a nice way I can do this using reflection, or some other black magic. This sort of thing:
var message = Something.Invoke("HostedResources.MESSAGE_CODE_" + code);
Thanks
Yes, you can use a reflection to get the property by name: