示例#1
0
 protected void FinalizePathEvaluation(Cache.EvaluationContext cacheContext, bool needToPopContext = false, bool needToPopApplyValues = false)
 {
     if (needToPopContext)
     {
         PopContext();
     }
     if (needToPopApplyValues)
     {
         PopApplyValues();
     }
     runtimeContentCache.leave(cacheContext);
 }
示例#2
0
        private object EvaluateExpressionOrValueInternal(string fusionPath, FusionAst fusionConfiguration, Cache.EvaluationContext cacheContext, AbstractFusionObject contextObject)
        {
            if (!EvaluateIfCondition(fusionConfiguration, fusionPath, contextObject))
            {
                FinalizePathEvaluation(cacheContext);
                return(null);
            }
            var evaluatedExpression = EvaluateEelExpressionOrSimpleValueWithProcessor(fusionPath, fusionConfiguration, contextObject);

            FinalizePathEvaluation(cacheContext);
            return(evaluatedExpression);
        }
示例#3
0
        private object EvaluateObjectOrRetrieveFromCache(AbstractFusionObject fusionObject, string fusionPath, FusionAst fusionConfiguration, Cache.EvaluationContext cacheContext)
        {
            object output           = null;
            var    evaluateObject   = true;
            var    evaluationStatus = EvaluationStatus.Skipped;

            if (runtimeContentCache.preEvaluate(cacheContext, fusionObject, out object cachedResult))
            {
                return(cachedResult);
            }
            if (!EvaluateIfCondition(fusionConfiguration, fusionPath, fusionObject))
            {
                evaluateObject = false;
            }
            if (evaluateObject)
            {
                output           = fusionObject.Evaluate();
                evaluationStatus = EvaluationStatus.Executed;
            }
            lastEvaluationStatus = evaluationStatus;
            if (evaluateObject)
            {
                output = EvaluateProcessors(output, fusionConfiguration, fusionPath, fusionObject);
            }
            // TODO
            // runtimeContentCache.postProcess(cacheContext, fusionObject, output);
            return(output);
        }