예제 #1
0
 private Boolean nietBestaandeAuteurCheck(Auteur auteur)   //true
 {
     if (this.Auteurs.Contains(auteur))
     {
         return(false); //hij bestaat al
     }
     else
     {
         return(true); // hij bestaat niet
     }
 }
예제 #2
0
 //toevoegingen
 public void addAuteur(Auteur auteur)
 {
     if (nietBestaandeAuteurCheck(auteur))   //kijken of hij al bestaat
     {
         this.Auteurs.Add(auteur);
     }
     else
     {
         throw new ArgumentException("Auteur " + auteur.Naam + " bestaat al");
     }
 }