Example #1
0
 /// <summary>
 /// Throws a <see cref="VncException"/> if a specific condition is not met.
 /// </summary>
 /// <param name="condition">
 /// The condition which should be met.
 /// </param>
 /// <param name="message">
 /// A <see cref="string"/> that describes the error.
 /// </param>
 /// <param name="reason">
 /// A <see cref="VncFailureReason"/> that describes the error.
 /// </param>
 public static void Require(bool condition, string message, Vnc.VncFailureReason reason)
 {
     if (!condition)
     {
         throw new Vnc.VncException(message, reason);
     }
 }
Example #2
0
 public static Throw VncRequires(this Throw self, bool condition, string message, Vnc.VncFailureReason reason)
 {
     if (!condition)
     {
         throw new Vnc.VncException(message, reason);
     }
     return(null);
 }