Example #1
0
        protected override void LoadTargetArgument(PointCut pc, AdviceArgument parameter)
        {
            var targetFuncType = _ts.MakeGenericInstanceType(
                _ts.FuncGeneric2,
                _ts.ObjectArray,
                _ts.Object);

            var targetFuncCtor = targetFuncType.Resolve().Methods.First(m => m.IsConstructor && !m.IsStatic).MakeHostInstanceGeneric(targetFuncType);
            var targetMethod   = _wrapper.MakeCallReference(GetOrCreateUnwrapper().MakeHostInstanceGeneric(_target.DeclaringType));

            pc.ThisOrNull().Call(targetFuncCtor, args => args.Load(targetMethod));
        }