Exemplo n.º 1
0
        void IDisposable.Dispose()
        {
            if (this.IsNullOrDisposed() || // ....
                (ShouldDispose = IEventExtensions.IsNull(this).Equals(false)))
            {
                return;
            }

            this.Event = null;

            ShouldDispose = false;
        }
Exemplo n.º 2
0
        internal static void Consume <T>(this IEvent @event, T t, System.Reflection.ParameterInfo[] parameterInfo = null)
        {
            if (IEventExtensions.IsNull(@event))
            {
                return;
            }

            System.Reflection.MethodInfo mi = @event.Source.Method;

            System.Reflection.ParameterInfo[] methodParams = parameterInfo ?? mi.GetParameters();

            System.Delegate @delegate = System.Delegate.CreateDelegate(typeof(T), mi);

            @delegate.DynamicInvoke();
        }