Ejemplo n.º 1
0
 private void CheckCat(Cat testCat)
 {
     if (testCat.Age <= 0)
     {
         // create a custom exception instance
         CustomCatException e = new CustomCatException("Your cat is too young.");
         e.HelpLink = "http://www.libertyassociates.com";
         throw e;
     }
 }
Ejemplo n.º 2
0
 private void CatManager(Cat kitty)
 {
     CheckCat(kitty);
     Console.WriteLine("Managing a cat who is " + kitty.Age + " years old");
 }