コード例 #1
0
 public static void Match <T1, T2, T3, T4>(this FSharpChoice <T1, T2, T3, T4> choice, Action <T1> action1, Action <T2> action2, Action <T3> action3, Action <T4> action4)
 {
     choice.Match(x => { action1(x); return(0); }, x => { action2(x); return(0); }, x => { action3(x); return(0); }, x => { action4(x); return(0); });
 }
コード例 #2
0
 public static Option <T3> GetChoice3Of3 <T1, T2, T3>(this FSharpChoice <T1, T2, T3> choice)
 {
     return(choice.Match(x => Option.None, x => Option.None, Option.GetSome));
 }
コード例 #3
0
 public static Option <T1> GetChoice1Of2 <T1, T2>(this FSharpChoice <T1, T2> choice)
 {
     return(choice.Match(Option.GetSome, x => Option.None));
 }
コード例 #4
0
 public static Option <T2> GetChoice2Of2 <T1, T2>(this FSharpChoice <T1, T2> choice)
 {
     return(choice.Match(x => Option.None, Option.GetSome));
 }
コード例 #5
0
 public static void Match <T1, T2>(this FSharpChoice <T1, T2> choice, Action <T1> action1, Action <T2> action2)
 {
     choice.Match(x => { action1(x); return(0); }, x => { action2(x); return(0); });
 }