コード例 #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);
     }
 }