public ImplementationClassWriter <TBase> Constructor(Func <MethodMember, AttributeWriter> attributes, Action <ConstructorWriter> body) { var constructor = DefineConstructor(ConstructorMethodFactory.InstanceConstructor(OwnerClass, Type.EmptyTypes)); var writer = new ConstructorWriter(constructor, body); writer.AddAttributes(attributes); return(this); }
public ImplementationClassWriter <TBase> Constructor <TA1>(Func <MethodMember, AttributeWriter> attributes, Action <ConstructorWriter, Argument <TA1> > body) { var constructor = DefineConstructor(ConstructorMethodFactory.InstanceConstructor(OwnerClass, new[] { typeof(TA1) })); var writer = new ConstructorWriter(constructor, w => body(w, w.Arg1 <TA1>())); writer.AddAttributes(attributes); return(this); }
public ImplementationClassWriter <TBase> Constructor <TA1, TA2, TA3, TA4, TA5, TA6, TA7, TA8>(Func <MethodMember, AttributeWriter> attributes, Action <ConstructorWriter, Argument <TA1>, Argument <TA2>, Argument <TA3>, Argument <TA4>, Argument <TA5>, Argument <TA6>, Argument <TA7>, Argument <TA8> > body) { var constructor = DefineConstructor(ConstructorMethodFactory.InstanceConstructor(OwnerClass, new[] { typeof(TA1), typeof(TA2), typeof(TA3), typeof(TA4), typeof(TA5), typeof(TA6), typeof(TA7), typeof(TA8) })); var writer = new ConstructorWriter(constructor, w => body(w, w.Arg1 <TA1>(), w.Arg2 <TA2>(), w.Arg3 <TA3>(), w.Arg4 <TA4>(), w.Arg5 <TA5>(), w.Arg6 <TA6>(), w.Arg7 <TA7>(), w.Arg8 <TA8>())); writer.AddAttributes(attributes); return(this); }