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); }
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)); }
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); }
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)); }