예제 #1
0
 public static BinaryExpression GetBinaryExpression(SemanticVersion left, ComparatorSet right)
 {
     if (right.Count() == 0)
     {
         return(GetBinaryExpression(ExpressionType.Equal, left, left));
     }
     else
     {
         BinaryExpression c = null;
         foreach (Comparator r in right)
         {
             if (c == null)
             {
                 c = GetBinaryExpression(r.Operator, left, r.Version);
             }
             else
             {
                 c = Expression.AndAlso(c, GetBinaryExpression(r.Operator, left, r.Version));
             }
         }
         return(c);
     }
 }
예제 #2
0
 public static bool Satisfies(SemanticVersion v, ComparatorSet s)
 {
     return(InvokeBinaryExpression(GetBinaryExpression(v, s)));
 }