protected override Delegate GetMethodDelegate(string method, Type returnValueType, Type[] args) { var parameters = new List <Type>(args) { returnValueType }; var delegateType = Expression.GetDelegateType(parameters.ToArray()); return(DynamicMethodGenerator.GenerateStaticMethod(method, delegateType, _OwnerType, args)); }
protected override Delegate GetMethodDelegate(string method, Type returnValueType, Type[] args) { var parameters = new List <Type> { _OwnerType }; parameters.AddRange(args); parameters.Add(returnValueType); var delegateType = Expression.GetDelegateType(parameters.ToArray()); return(DynamicMethodGenerator.GenerateInstanceMethod(method, delegateType, _OwnerType, args)); }
protected override Action <object, object> CreateSetter(string name) { var del = DynamicMethodGenerator.GenerateStaticPropertySetter(OwnerType, name); if (del == null) { return(null); } var helper = new SetterHelper(del); return(helper.CreateSetter); }
protected override Func <object, object> CreateGetter(string name) { var del = DynamicMethodGenerator.GenerateStaticFieldGetter(OwnerType, name); if (del == null) { return(null); } var helper = new GetterHelper(del); return(helper.CreateGetter); }
protected override Action <object, object> CreateSetter(string name) { return(DynamicMethodGenerator.GenerateInstancePropertySetter(OwnerType, name)); }
protected override Func <object, object> CreateGetter(string name) { return(DynamicMethodGenerator.GenerateInstanceFieldGetter(OwnerType, name)); }