Exemple #1
0
 private static void ShouldThrowEx()
 {
     try
     {
         var c = new ClassThatThrow();
         DynamicCode.GetProperty(c, "IThrowAnException");
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
Exemple #2
0
 private static void MispelledProperty()
 {
     try
     {
         var c = new ClassThatThrow();
         DynamicCode.GetProperty(c, "IDoNotExist");
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }