public IInvokable RegisterInvokable(InvokableInfo info, MethodInfo methodInfo, object instance = null)
        {
            IInvokable invokable = InvokableFactory.MakeInvokable(info, methodInfo, instance);

            RegisterInvokable(invokable);
            return(invokable);
        }
        public IInvokable RegisterInvokable(InvokableInfo info, EventInfo eventInfo, object instance = null)
        {
            IInvokable invokable = InvokableFactory.MakeInvokable(info, eventInfo, instance);

            RegisterInvokable(invokable);
            return(invokable);
        }
        public IInvokable RegisterInvokable(InvokableInfo info, Delegate del)
        {
            IInvokable invokable = InvokableFactory.MakeInvokable(info, del);

            RegisterInvokable(invokable);
            return(invokable);
        }
Example #4
0
        public InvokableEvent(InvokableInfo info, EventInfo eventInfo, FieldInfo fieldInfo, WeakReference instance)
            : base(info, fieldInfo.DeclaringType, fieldInfo.ReflectedType.Assembly, instance, fieldInfo.IsPublic)
        {
            this.fieldInfo  = fieldInfo;
            methodSignature = "[Unknown]";
            MethodInfo method = eventInfo.EventHandlerType.GetMethod("Invoke");

            SetParameters(method.GetParameters());
            methodSignature = method.GetSignature();
        }
Example #5
0
 public static IInvokable MakeInvokableFromBackingEventField(InvokableInfo info, EventInfo eventInfo, FieldInfo fieldInfo, object instance)
 {
     return(new InvokableEvent(info, eventInfo, fieldInfo, (instance == null) ? null : new WeakReference(instance)));
 }
Example #6
0
 public static IInvokable MakeInvokable(InvokableInfo info, MethodInfo methodInfo, object instance)
 {
     return(new InvokableMethod(info, methodInfo, (instance == null) ? null : new WeakReference(instance)));
 }
Example #7
0
        public static IInvokable MakeInvokable(InvokableInfo info, EventInfo eventInfo, object instance)
        {
            FieldInfo backingEventField = GetBackingEventField(eventInfo, instance);

            return(MakeInvokableFromBackingEventField(info, eventInfo, backingEventField, instance));
        }
Example #8
0
 public static IInvokable MakeInvokable(InvokableInfo info, Delegate del)
 {
     return(new InvokableMethod(info, del));
 }
Example #9
0
 public InvokableMethod(InvokableInfo info, Delegate methodDelegate)
     : base(info, methodDelegate.Method.DeclaringType, methodDelegate.Method.ReflectedType.Assembly, (methodDelegate.Target == null) ? null : new WeakReference(methodDelegate.Target), methodDelegate.Method.IsPublic, methodDelegate.Method.GetParameters())
 {
     methodInfo      = methodDelegate.Method;
     methodSignature = methodInfo.GetSignature();
 }
Example #10
0
 public InvokableMethod(InvokableInfo info, MethodInfo methodInfo, WeakReference instance)
     : base(info, methodInfo.DeclaringType, methodInfo.ReflectedType.Assembly, instance, methodInfo.IsPublic, methodInfo.GetParameters())
 {
     this.methodInfo = methodInfo;
     methodSignature = methodInfo.GetSignature();
 }
Example #11
0
 public BaseInvokable(InvokableInfo info, Type declaringType, Assembly assembly, WeakReference instance, bool isPublic)
     : base(info, assembly, instance, isPublic)
 {
     this.declaringType = declaringType;
     InvokableInfo      = info;
 }
Example #12
0
 public BaseInvokable(InvokableInfo info, Type declaringType, Assembly assembly, WeakReference instance, bool isPublic, ParameterInfo[] parameters)
     : this(info, declaringType, assembly, instance, isPublic)
 {
     this.declaringType = declaringType;
     SetParameters(parameters);
 }