Beispiel #1
0
        public ICodegenBlock AddMethod(Type returnType, Type generator)
        {
            string methodName = CodeGenerationIDGenerator.GenerateMethod();
            var    method     = new CodegenMethod(
                returnType, methodName, Collections.GetEmptyList <CodegenNamedParam>(), GetGeneratorDetail(generator));

            _methods.Add(method);
            return(method.Statements);
        }
Beispiel #2
0
        public ICodegenBlock AddMethod(Type returnType, Type paramType, string paramName, Type generator)
        {
            string methodName = CodeGenerationIDGenerator.GenerateMethod();
            var    method     = new CodegenMethod(
                returnType, methodName, Collections.SingletonList(new CodegenNamedParam(paramType, paramName)),
                GetGeneratorDetail(generator));

            _methods.Add(method);
            return(method.Statements);
        }