Пример #1
0
 public CodegenExpression EvaluateEventGetEventBeanCodegen(
     CodegenMethodScope methodScope,
     ExprEnumerationGivenEventSymbol symbols,
     CodegenClassScope codegenClassScope)
 {
     return ConstantNull();
 }
Пример #2
0
        public CodegenExpression EvaluateEventGetROCollectionScalarCodegen(
            CodegenMethodScope methodScope,
            ExprEnumerationGivenEventSymbol symbols,
            CodegenClassScope codegenClassScope)
        {
            if (getterReturnType.IsGenericCollection()) {
                return getter.EventBeanGetCodegen(
                    symbols.GetAddEvent(methodScope),
                    methodScope,
                    codegenClassScope);
            }

            CodegenMethod method = methodScope.MakeChild(
                typeof(ICollection<object>),
                typeof(PropertyDotScalarIterable),
                codegenClassScope);
            method.Block.DeclareVar(
                    getterReturnType,
                    "result",
                    CodegenLegoCast.CastSafeFromObjectType(
                        typeof(IEnumerable),
                        getter.EventBeanGetCodegen(symbols.GetAddEvent(method), methodScope, codegenClassScope)))
                .IfRefNullReturnNull("result")
                .MethodReturn(StaticMethod(typeof(CollectionUtil), "IterableToCollection", Ref("result")));
            return LocalMethod(method);
        }
Пример #3
0
 public CodegenExpression EvaluateEventGetROCollectionScalarCodegen(
     CodegenMethodScope methodScope,
     ExprEnumerationGivenEventSymbol symbols,
     CodegenClassScope codegenClassScope)
 {
     var method = methodScope.MakeChild(
         typeof(FlexCollection),
         typeof(PropertyDotScalarArrayForge),
         codegenClassScope);
     method.Block
         .IfRefNullReturnNull(symbols.GetAddEvent(method))
         .MethodReturn(
             CodegenEvaluateGetInternal(symbols.GetAddEvent(method), methodScope, codegenClassScope));
     return LocalMethod(method);
 }
Пример #4
0
 public CodegenExpression EvaluateEventGetROCollectionScalarCodegen(
     CodegenMethodScope methodScope,
     ExprEnumerationGivenEventSymbol symbols,
     CodegenClassScope codegenClassScope)
 {
     var methodNode = methodScope.MakeChild(
         typeof(ICollection<object>),
         typeof(PropertyDotScalarCollection),
         codegenClassScope);
     methodNode.Block.MethodReturn(
         CodegenLegoCast.CastSafeFromObjectType(
             typeof(ICollection<object>),
             getter.EventBeanGetCodegen(
                 symbols.GetAddEvent(methodNode),
                 methodScope,
                 codegenClassScope)));
     return LocalMethod(methodNode);
 }
Пример #5
0
 public CodegenExpression EvaluateEventGetROCollectionEventsCodegen(
     CodegenMethodScope methodScope,
     ExprEnumerationGivenEventSymbol symbols,
     CodegenClassScope codegenClassScope)
 {
     var methodNode = methodScope.MakeChild(
         typeof(FlexCollection),
         typeof(PropertyDotEventCollectionForge),
         codegenClassScope);
     methodNode.Block
         .IfNullReturnNull(symbols.GetAddEvent(methodNode))
         .MethodReturn(
             CodegenEvaluateInternal(
                 symbols.GetAddEvent(methodNode),
                 method => symbols.GetAddExprEvalCtx(method),
                 methodNode,
                 codegenClassScope));
     return LocalMethod(methodNode);
 }
Пример #6
0
 public CodegenExpression EvaluateEventGetEventBeanCodegen(
     CodegenMethodScope parent,
     ExprEnumerationGivenEventSymbol symbols,
     CodegenClassScope codegenClassScope)
 {
     var methodNode = parent.MakeChild(
         typeof(EventBean),
         typeof(PropertyDotEventSingleForge),
         codegenClassScope);
     methodNode.Block
         .IfRefNullReturnNull(symbols.GetAddEvent(methodNode))
         .MethodReturn(
             Cast(
                 typeof(EventBean),
                 getter.EventBeanFragmentCodegen(
                     symbols.GetAddEvent(methodNode),
                     methodNode,
                     codegenClassScope)));
     return LocalMethod(methodNode);
 }