Beispiel #1
0
 public static void Default <TCase, TOther>(this SwithCaseExt.SwithCase <TCase, TOther> sc, TOther other)
 {
     if (sc == null)
     {
         return;
     }
     sc.Action(other);
 }
Beispiel #2
0
 public static SwithCaseExt.SwithCase <TCase, TOther> Case <TCase, TOther>(this SwithCaseExt.SwithCase <TCase, TOther> sc, Predicate <TCase> predict, TOther other, bool bBreak) where TCase : IEquatable <TCase>
 {
     if (sc == null)
     {
         return((SwithCaseExt.SwithCase <TCase, TOther>)null);
     }
     if (!predict(sc.Value))
     {
         return(sc);
     }
     sc.Action(other);
     if (!bBreak)
     {
         return(sc);
     }
     return((SwithCaseExt.SwithCase <TCase, TOther>)null);
 }