-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phone #8
Comments
This is a sealed class so cannot inheritate, in two minds to do this then. |
Bumping a bit of an old thread, but was curious how this might work out... Wondering if this is the right approach? [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
public class UmbracoPhoneAttribute : DataTypeAttribute
{
private static PhoneAttribute _wrapper = new PhoneAttribute();
public UmbracoPhoneAttribute(string errorMessageDictionaryKey)
: base(DataType.PhoneNumber)
{
this.ErrorMessage = UmbracoValidationHelper.GetDictionaryItem(errorMessageDictionaryKey);
_wrapper.ErrorMessage = this.ErrorMessage;
}
public override bool IsValid(object value)
{
return _wrapper.IsValid(value);
}
} Not that I need this code myself at the moment, just had a programmer's itch to scratch ;-) For reference, the source for |
Hey @leekelleher this looks perfectly good to me mate and I would love a Pull Request if you want to do it. I need to make/find time as there is an issue with these in a newer version of 7 as described on issue tracker, but as always I can never find the time to give all projects love, care & attention they need. So any contributions is more than welcome 👍 |
@warrenbuckley I know exactly what you mean - I'm facing the same on my various projects I'll see what I can do! 🤘 |
http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.phoneattribute(v=vs.110).aspx
The text was updated successfully, but these errors were encountered: