コード例 #1
0
ファイル: Person.cs プロジェクト: 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.");
     }
 }
コード例 #2
0
ファイル: Person.cs プロジェクト: 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.");
     }
 }