예제 #1
0
 public static AsyncOperand OrAsync(AsyncOperand a, AsyncOperand b)
 {
     return(new LazyOperand(async delegate
     {
         if (await a.ToBoolAsync().ConfigureAwait(false))
         {
             return new BoolOperand(true);
         }
         return (await b.ToBoolAsync().ConfigureAwait(false)) ? new BoolOperand(true) : new BoolOperand(false);
     }));
 }
예제 #2
0
 public static async Task <AsyncOperand> Not(AsyncOperand a)
 {
     return(new BoolOperand(!(await a.ToBoolAsync().ConfigureAwait(false))));
 }
예제 #3
0
 public static AsyncOperand AndAsync(AsyncOperand a, AsyncOperand b)
 {
     return(new LazyOperand(async() => (await a.ToBoolAsync().ConfigureAwait(false) && await b.ToBoolAsync().ConfigureAwait(false)) ? new BoolOperand(true) : new BoolOperand(false)));
 }