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