Esempio n. 1
0
File: Person.cs Progetto: boroppi/A3
 // validates if the parameter matches to regex pattern then sets the properties
 public void SetLastName(string lname)
 {
     if (RegexMatch.NameMatchesRegex(lname))
     {
         LastName = lname;
     }
     else
     {
         throw new ArgumentException("Last Name does not match required format.");
     }
 }
Esempio n. 2
0
File: Person.cs Progetto: boroppi/A3
 // validates if the parameter matches to regex pattern then sets the properties
 public void SetFirstName(string fname)
 {
     if (RegexMatch.NameMatchesRegex(fname))
     {
         FirstName = fname;
     }
     else
     {
         throw new ArgumentException("First Name does not match required format.");
     }
 }