Beispiel #1
0
 private string GetCodegen(ICodegenContext context)
 {
     return(context.AddMethod(typeof(object), typeof(GenericRecord), "record", this.GetType())
            .DeclareVar(
                typeof(GenericRecord), "inner",
                StaticMethodTakingExprAndConst(this.GetType(), "GetAtIndex", Ref("record"), _posTop, _index))
            .IfRefNullReturnNull("inner")
            .MethodReturn(_nested.CodegenUnderlyingGet(Ref("inner"), context)));
 }
 private string GetCodegen(ICodegenContext context)
 {
     return(context.AddMethod(typeof(Object), typeof(GenericRecord), "record", GetType())
            .DeclareVar(typeof(GenericRecord), "inner", Cast(typeof(GenericRecord), ExprDotMethod(Ref("record"), "get", Constant(_fieldTop))))
            .MethodReturn(Conditional(EqualsNull(Ref("inner")), ConstantNull(), _getter.CodegenUnderlyingGet(Ref("inner"), context))));
 }