public void catcher <S> (ThrowDelegate thrower)
 {
     try {
         thrower();
     }
     catch (GenExc <S, T> ) {
     }
 }
示例#2
0
 /// <summary>
 ///Throw an exception if the specified condition is true. 
 ///Assert.False (test, NYIException.Throw, "test was true")
 /// </summary>
 /// <param name="Condition">The condition</param>
 /// <param name="Throw">Delegate that creates the exception to be thrown if
 /// Condition is true</param>
 /// <param name="Reason">Reason, for debugging</param>
 public static void False(bool Condition, ThrowDelegate Throw, object Reason) {
     if (Condition) {
         if (Reason as string != null) {
             throw Throw(Reason as string);
             }
         else {
             throw Throw("");
             }
         }
     }
示例#3
0
 /// <summary>
 ///Throw an exception if the specified object is null. 
 ///Throw.False (Object, NYIException.Throw)
 /// </summary>
 /// <param name="Object">The condition</param>
 /// <param name="Throw">Delegate that creates the exception to be thrown if
 /// Condition is true</param>
 public static void Null(object Object, ThrowDelegate Throw) {
     Null(Object, Throw, null);
     }
示例#4
0
 /// <summary>
 ///Throw an exception if the specified object is null. 
 ///Throw.False (Object, NYIException.Throw, "Object was null")
 /// </summary>
 /// <param name="Object">The condition</param>
 /// <param name="Throw">Delegate that creates the exception to be thrown if
 /// Condition is true</param>
 /// <param name="Reason">Reason, for debugging</param>
 public static void Null(object Object, ThrowDelegate Throw, string Reason) {
     True(Object == null, Throw, Reason);
     }
示例#5
0
 /// <summary>
 ///Throw an exception if the specified condition is false. 
 ///Assert.True (test, NYIException.Throw, "test was false")
 /// </summary>
 /// <param name="Condition">The condition</param>
 /// <param name="Throw">Delegate that creates the exception to be thrown if
 /// Condition is true</param>
 public static void True(bool Condition, ThrowDelegate Throw) {
     True(Condition, Throw, null);
     }
示例#6
0
 /// <summary>
 ///Throw an exception if the specified condition is false. 
 ///Assert.True (test, NYIException.Throw, "test was false")
 /// </summary>
 /// <param name="Condition">The condition</param>
 /// <param name="Throw">Delegate that creates the exception to be thrown if
 /// Condition is true</param>
 /// <param name="Reason">Reason, for debugging</param>
 public static void True(bool Condition, ThrowDelegate Throw, string Reason) {
     False(!Condition, Throw, Reason);
     }
示例#7
0
 /// <summary>
 ///Throw an exception if the specified condition is true. 
 ///Assert.False (test, NYIException.Throw, "test was true")
 /// </summary>
 /// <param name="Condition">The condition</param>
 /// <param name="Throw">Delegate that creates the exception to be thrown if
 /// Condition is true</param>
 public static void False(bool Condition, ThrowDelegate Throw) {
     False(Condition, Throw, null);
     }