public void OverrideMethod(MethodInfo info, Action <OverrideMethodContext> nestedClosure)
        {
            var addMethodAction = new AddMethodAction(Builder, () => () => info.Name, () => () => info.ReturnType, () => info.GetParameters().Select(p => p.ParameterType).ToArray(), true);

            TypeGenerationActions.Add(addMethodAction);

            var method = new GeneratedMethod(() => addMethodAction.MethodBuilder, TypeGenerationActions);

            var context = new OverrideMethodContext(info, method, this);

            nestedClosure(context);

            if (!context.ReturnDeclared)
            {
                method.ReturnFrom();
            }
        }
Exemple #2
0
 public void Return()
 {
     MethodContext.ReturnDeclared = true;
     GeneratedMethod.ReturnFrom();
 }