예제 #1
0
 public void Poll()
 {
     arg.Poll();
     if ((GotValue = arg.GotValue && predicate(arg.Value)))
     {
         Value = arg.Value;
     }
 }
예제 #2
0
 void Execute()
 {
     dataflow.Poll();
     if (dataflow.GotValue)
     {
         action(dataflow.Value);
     }
 }
예제 #3
0
 public void Poll()
 {
     arg.Poll();
     if ((GotValue = arg.GotValue))
     {
         Value = selector(arg.Value);
     }
 }
예제 #4
0
 public void Consume()
 {
     dataflow.Poll();
     if (dataflow.GotValue)
     {
         action(dataflow.Value);
     }
 }
예제 #5
0
 public void Poll()
 {
     arg1.Poll();
     arg2.Poll();
     if ((GotValue = arg1.GotValue || arg2.GotValue))
     {
         Value = EqualityComparer <T> .Default.Equals(arg1.Value, arg2.Value) ? arg1.Value : defaultValue;
     }
 }
예제 #6
0
 public void Poll()
 {
     arg.Poll();
     if ((GotValue = arg.GotValue && (done || countdown-- <= 0)))
     {
         done  = true;
         Value = arg.Value;
     }
 }
예제 #7
0
 public void Poll()
 {
     arg1.Poll();
     if ((GotValue = arg1.GotValue))
     {
         arg2.Poll();
         Value = new Tuple <T1, T2>(arg1.Value, arg2.Value);
     }
 }
예제 #8
0
 public void Poll()
 {
     arg.Poll();
     if ((GotValue = arg.GotValue))
     {
         var current = arg.Value;
         if ((GotValue = !hasValue || !EqualityComparer <T> .Default.Equals(current, previous)))
         {
             Value    = current;
             hasValue = true;
             previous = current;
         }
     }
 }
예제 #9
0
 public static bool Poll <T>(this IDataflow <T> dataflow, out T value)
 {
     dataflow.Poll();
     value = dataflow.Value;
     return(dataflow.GotValue);
 }