I am stepping into the world of validation attributes in an attempt to subscribe more strongly to DRY. I do not use the in-the-box resource system because by experience it is buggy as hell. So I've developed an XML based resource provider that is so much better, but I find I can't use it with the System.ComponentModel.DataAnnotations.ValidationAttribute
family of classes. It seems like a huge restriction to require a resource type to have hard-coded static properties for its resources. I would have thought an interface would have been more reasonable. Is there a way i can hack this using reflection or something so that the resourcing system for these attributes think that they are reading from a static property but are actually going though my component's method?
This is the interface for my resource provider.
public interface IStringProvider
{
String GetValue(String a_name, params Object[] a_params);
}
For now, I guess I have to create static property "stand-ins" which is a lot of extra code, I'd like to avoid.
Thanks always.