private string GetValidationError(string propertyName) { if (Array.IndexOf(ValidatedProperties, propertyName) < 0) { return(null); } string error = null; switch (propertyName) { case "Email": error = StringValidation.ValidateEmail(Email, true); break; case "Subject": error = StringValidation.ValidateRequired(propertyName, this.Subject); break; case "Content": error = StringValidation.ValidateRequired(propertyName, this.Content); break; default: Debug.Fail("Unexpected property being validated on EmailContent: " + propertyName); break; } return(error); }
private string GetValidationError(string propertyName) { if (Array.IndexOf(ValidatedProperties, propertyName) < 0) { return(null); } string error = null; switch (propertyName) { case "Phone": error = StringValidation.ValidatePhone(Phone, true); break; case "Message": error = StringValidation.ValidateRequired(propertyName, this.Message); break; default: Debug.Fail("Unexpected property being validated on SMSContent: " + propertyName); break; } return(error); }
private string GetValidationError(string propertyName) { if (Array.IndexOf(ValidatedProperties, propertyName) < 0) { return(null); } string error = null; switch (propertyName) { case "Summary": error = StringValidation.ValidateRequired(propertyName, Summary); break; case "StartTime": error = this.ValidateStartTime(); break; case "EndTime": error = this.ValidateEndTime(); break; default: Debug.Fail("Unexpected property being validated on iCal: " + propertyName); break; } return(error); }
private string GetValidationError(string propertyName) { //Check if property is in validation list. //If not, then it's not require to be validated. if (Array.IndexOf(ValidatedProperties, propertyName) < 0) { return(null); } string error = null; switch (propertyName) { case "FirstName": error = StringValidation.ValidateRequired(propertyName, FirstName); break; case "Mobile": error = StringValidation.ValidatePhone(Mobile, false); break; case "PhoneHome": error = StringValidation.ValidatePhone(PhoneHome, false); break; case "PhoneWork": error = StringValidation.ValidatePhone(PhoneWork, false); break; case "FaxHome": error = StringValidation.ValidatePhone(FaxHome, false); break; case "FaxWork": error = StringValidation.ValidatePhone(FaxWork, false); break; case "Email": error = StringValidation.ValidateEmail(Email, false); break; case "URL": error = StringValidation.ValidateUrl(URL, false); break; case "BirthDay": error = StringValidation.ValidateBirthday(BirthDay); break; default: Debug.Fail("Unexpected property being validated on vCardContent: " + propertyName); break; } return(error); }