Beispiel #1
0
        protected override IEnumerable <LessNode> EvaluateCore(EvaluationContext context)
        {
            // For ratio queries where the value is a fraction, don't evaluate the division
            var actualRule = IsFractionalRatio()
                                ? rule
                                : rule.EvaluateSingle <Rule>(context);

            yield return(new MediaPropertyQuery(Modifier, actualRule));

            bool IsFractionalRatio()
            {
                return(rule.Property.EndsWith("ratio") && rule.Value is MathOperation op && op.Operator == "/");
            }
        }
Beispiel #2
0
 protected override IEnumerable <LessNode> EvaluateCore(EvaluationContext context)
 {
     yield return(new PropertySupportsCondition(Negate, property.EvaluateSingle <Rule>(context)));
 }