Beispiel #1
0
 public Output Process(Input input)
 {
     if (Choice(input))
     {
         if (Step != null)
         {
             return(Step.Process(input));
         }
     }
     return(input);
 }
Beispiel #2
0
 public static Output OptionStep <Input, Output>(this Input input, IPipeLineStep <Input, Output> step, Func <Input, bool> choice)
     where Input : Output
 {
     System.Diagnostics.Trace.WriteLine("{0} Processing.", step.GetType().Name);
     return(choice(input) ? step.Process(input) : input);
 }
Beispiel #3
0
 /// <summary>
 /// 定义泛型扩展方法
 /// </summary>
 /// <typeparam name="Input"></typeparam>
 /// <typeparam name="Output"></typeparam>
 /// <param name="input"></param>
 /// <param name="step"></param>
 /// <returns></returns>
 public static Output Step <Input, Output>(this Input input, IPipeLineStep <Input, Output> step)
 {
     System.Diagnostics.Trace.WriteLine("{0} Processing.", step.GetType().Name);
     return(step.Process(input));
 }
Beispiel #4
0
 public Output Process(Input input)
 {
     return(Choice(input) ? Step.Process(input) : input);
 }