public CodegenExpression EvaluateCodegen(
            Type requiredType,
            CodegenMethodScope codegenMethodScope,
            ExprForgeCodegenSymbol exprSymbol,
            CodegenClassScope codegenClassScope)
        {
            if (_firstRowOnly) {
                CodegenMethod firstMethodNode = codegenMethodScope
                    .MakeChild(typeof(EventBean), typeof(ExprEvalEnumerationCollForge), codegenClassScope);
                firstMethodNode.Block
                    .DeclareVar<FlexCollection>(
                        "events",
                        _enumerationForge.EvaluateGetROCollectionEventsCodegen(
                            firstMethodNode,
                            exprSymbol,
                            codegenClassScope))
                    .IfRefNullReturnNull("events")
                    .IfCondition(EqualsIdentity(ExprDotName(Ref("events"), "Count"), Constant(0)))
                    .BlockReturn(ConstantNull())
                    .MethodReturn(StaticMethod(typeof(EventBeanUtility), "GetNonemptyFirstEvent", Ref("events")));
                return LocalMethod(firstMethodNode);
            }

            CodegenMethod methodNode = codegenMethodScope.MakeChild(
                typeof(EventBean[]),
                typeof(ExprEvalEnumerationCollForge),
                codegenClassScope);
            methodNode.Block
                .DeclareVar<FlexCollection>(
                    "events",
                    FlexWrap(_enumerationForge.EvaluateGetROCollectionEventsCodegen(methodNode, exprSymbol, codegenClassScope)))
                .IfRefNullReturnNull("events")
                .MethodReturn(ExprDotMethod(ExprDotName(Ref("events"), "EventBeanCollection"), "ToArray"));
            return LocalMethod(methodNode);
        }
예제 #2
0
 public CodegenExpression EvaluateCodegen(
     Type requiredType,
     CodegenMethodScope codegenMethodScope,
     ExprForgeCodegenSymbol exprSymbol,
     CodegenClassScope codegenClassScope)
 {
     return _enumeration.EvaluateGetROCollectionEventsCodegen(codegenMethodScope, exprSymbol, codegenClassScope);
 }
예제 #3
0
 public CodegenExpression EvaluateCodegen(
     Type requiredType,
     CodegenMethodScope codegenMethodScope,
     ExprForgeCodegenSymbol exprSymbol,
     CodegenClassScope codegenClassScope)
 {
     CodegenMethod methodNode = codegenMethodScope.MakeChild(
         typeof(EventBean[]),
         this.GetType(),
         codegenClassScope);
     methodNode.Block
         .DeclareVar<FlexCollection>(
             "result",
             FlexWrap(enumerationForge.EvaluateGetROCollectionEventsCodegen(methodNode, exprSymbol, codegenClassScope)))
         .IfRefNullReturnNull(Ref("result"))
         .MethodReturn(ExprDotMethod(ExprDotName(Ref("result"), "EventBeanCollection"), "ToArray"));
     return LocalMethod(methodNode);
 }