Ejemplo n.º 1
0
        public virtual void InterceptRemove(object[] parameters, params IInterceptor[] interceptors)
        {
            var method = @event.RemoveMethod;
            var target = method.IsStatic ? null : typeAccessor.Target;

            ReflectionInterception.Intercept(@event, method, target, parameters, typeof(IRemoveOnInterceptorProvider), interceptors);
        }
Ejemplo n.º 2
0
        public virtual object InterceptGet(object[] parameters, params IInterceptor[] interceptors)
        {
            if (!property.CanRead)
            {
                throw new InvalidOperationException($"Property '{property.Name}' cannot read.");
            }

            var method = property.GetMethod;
            var target = method.IsStatic ? null : typeAccessor.Target;

            return(ReflectionInterception.Intercept(property, method, target, parameters, typeof(IGetterInterceptorProvider), interceptors));
        }
Ejemplo n.º 3
0
        public virtual void InterceptSet(object[] parameters, params IInterceptor[] interceptors)
        {
            if (!property.CanWrite)
            {
                throw new InvalidOperationException($"Cannot write Property '{property.Name}'");
            }

            var method = property.SetMethod;
            var target = method.IsStatic ? null : typeAccessor.Target;

            ReflectionInterception.Intercept(property, method, target, parameters, typeof(ISetterInterceptorProvider), interceptors);
        }
Ejemplo n.º 4
0
        public object Intercept(object[] parameters, params IInterceptor[] interceptors)
        {
            var target = method.IsStatic ? null : typeAccessor.Target;

            return(ReflectionInterception.Intercept(method, method, target, parameters, typeof(IMethodInterceptorProvider), interceptors));
        }