Exemplo n.º 1
0
 public GeneratedParameter(Type type, int parameterIndex, BaseTypeGenerationContext context, Func <Func <ILGenerator> > builder)
 {
     this.context    = context;
     this.builder    = builder;
     this.type       = type;
     this.LocalIndex = parameterIndex;
 }
Exemplo n.º 2
0
 public GeneratedParameter(Func <GeneratedField> field, int parameterIndex, BaseTypeGenerationContext context, Func <Func <ILGenerator> > builder)
 {
     this.field      = field;
     this.context    = context;
     this.builder    = builder;
     this.LocalIndex = parameterIndex;
 }
Exemplo n.º 3
0
 public MethodBodyContext(GeneratedMethod method, BaseTypeGenerationContext typeGenerationContext, BaseMethodGenerationContext context)
 {
     this.GeneratedMethod       = method;
     this.TypeGenerationContext = typeGenerationContext;
     this.MethodContext         = context;
     this.generator             = new DelegateGenerator(typeGenerationContext);
 }
Exemplo n.º 4
0
        public MethodGenerationContext(BaseTypeGenerationContext typeGenerationContext, Action <MethodGenerationContext> closure) : base(typeGenerationContext)
        {
            addMethodAction = new AddMethodAction(typeGenerationContext.Builder, () => Name, () => ReturnType, GetParameters, false);
            typeGenerationContext.TypeGenerationActions.Add(addMethodAction);

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

            SetMethod(method);

            closure(this);
        }
Exemplo n.º 5
0
        public ConstructorGenerationContext(BaseTypeGenerationContext context, Action <ConstructorGenerationContext> closure)
        {
            this.Arguments = new List <IGeneratedParameter>();

            this.context = context;

            var action = new AddConstructorAction(context.Builder, () => this.Arguments.Select(arg => arg.Type).ToList());

            context.TypeGenerationActions.Add(action);
            constructorAction = action;

            closure(this);
            context.TypeGenerationActions.Add(new ConstructorReturnAction(() => action.Constructor));
        }
Exemplo n.º 6
0
 public DelegateGenerator(BaseTypeGenerationContext context)
 {
     argumentTypes = new List <Type>();
     this.context  = context;
 }
Exemplo n.º 7
0
 protected BaseMethodGenerationContext(BaseTypeGenerationContext typeGenerationContext)
 {
     this.typeGenerationContext = typeGenerationContext;
 }
Exemplo n.º 8
0
 public OverrideMethodContext(MethodInfo info, GeneratedMethod method, BaseTypeGenerationContext typeGenerationContext) : base(typeGenerationContext)
 {
     this.info = info;
     SetMethod(method);
 }