Ejemplo n.º 1
0
 public PrimitiveCondition[] GeneratePrimitiveConditions(string input)
 {
     PrimitiveCondition[] primitiveConditions = new PrimitiveCondition[0];
     if (Start.HasValue && End.HasValue && Start.Value.CompareTo(End.Value) == 0)
     {
         if (IncludeStart && IncludeEnd)
         {
             primitiveConditions = new PrimitiveCondition[] { new PrimitiveCondition(input, GetNormalizeValue(Start.Value)) };
         }
         else if (!IncludeStart && !IncludeEnd)
         {
             primitiveConditions = new PrimitiveCondition[] { new PrimitiveCondition(input, GetNormalizeValue(Start.Value), ComparisonOperator.NE) };
         }
     }
     else
     {
         PrimitiveCondition startCondition = GeneratePrimitiveConditionForStart(input);
         PrimitiveCondition endCondition   = GeneratePrimitiveConditionForEnd(input);
         if (startCondition != null && endCondition != null)
         {
             primitiveConditions = new PrimitiveCondition[] { startCondition, endCondition };
         }
         else if (startCondition != null && endCondition == null)
         {
             primitiveConditions = new PrimitiveCondition[] { startCondition };
         }
         else if (startCondition == null && endCondition != null)
         {
             primitiveConditions = new PrimitiveCondition[] { endCondition };
         }
     }
     return(primitiveConditions);
 }
Ejemplo n.º 2
0
 public Condition(PrimitiveCondition primitiveCondition)
     : this()
 {
     Name  = primitiveCondition.Name;
     Value = TryCast(primitiveCondition.Value);
     ComparisonOperator = primitiveCondition.ComparisonOperator;
 }