예제 #1
0
        public sealed override Delegate CreateDelegate(Type delegateType, Object target)
        {
            if (ReflectionTrace.Enabled)
            {
                ReflectionTrace.MethodInfo_CreateDelegate(this, delegateType, target);
            }

            return(CreateDelegate(delegateType, target, allowClosedInstanceDelegates: true));
        }
예제 #2
0
        // V4.5 api - Creates open or closed delegates over static or instance methods.
        public sealed override Delegate CreateDelegate(Type delegateType, Object target)
        {
#if ENABLE_REFLECTION_TRACE
            if (ReflectionTrace.Enabled)
            {
                ReflectionTrace.MethodInfo_CreateDelegate(this, delegateType, target);
            }
#endif

            return(CreateDelegateWorker(delegateType, target, allowClosed: true));
        }
예제 #3
0
        public sealed override Delegate CreateDelegate(Type delegateType)
        {
            if (ReflectionTrace.Enabled)
            {
                ReflectionTrace.MethodInfo_CreateDelegate(this, delegateType);
            }

            // Legacy: The only difference between calling CreateDelegate(type) and CreateDelegate(type, null) is that the former
            // disallows closed instance delegates for V1.1 backward compatibility.
            return(CreateDelegate(delegateType, null, allowClosedInstanceDelegates: false));
        }