Ejemplo n.º 1
0
 public bool IsValidUrl()
 {
     if (!string.IsNullOrEmpty(this.LinkUrl))
     {
         return(_Val.IsValid(_Val.URL, this.LinkUrl));
     }
     else
     {
         throw new ArgumentNullException("LinkUrl", "Value for LinkUrl Must Be Provided!");
     }
 }
 public bool IsValidPhoneNumber(string phone)
 {
     if (!string.IsNullOrEmpty(phone))
     {
         return(_Val.IsValid(_Val.PhoneNumber, phone));
     }
     else
     {
         throw new ArgumentNullException("phone", "Value for Phone Number Must Be Provided!");
     }
 }
 public EmailAddress(string value) : this()
 {
     if (!string.IsNullOrEmpty(value))
     {
         if (_Val.IsValid(_Val.EmailAddress, value))
         {
             var str = value.Split('@');
             this.Username = str[0];
             this.Domain   = str[1];
             this.Value    = value;
             this.Type     = EmailAddressType.Default;
         }
         else
         {
             throw new ArgumentException("value", "Email must be in correct format!");
         }
     }
     else
     {
         throw new ArgumentNullException("value", "Value for Email Must Be Provided!");
     }
 }