public static InterceptorType GetInterceptorType(this InterceptorBase interceptorBase)
        {
            InterceptorType interceptorType = new InterceptorType();

            interceptorType.priority = interceptorBase.priority;
            interceptorType.type     = interceptorBase.GetType();
            if (typeof(IBeforeInterceptor).IsAssignableFrom(interceptorType.type) && typeof(IAfterInterceptor).IsAssignableFrom(interceptorType.type))
            {
                interceptorType.runType = EnumInterceptorRunType.BeforeAfter;
            }
            else if (typeof(IAfterInterceptor).IsAssignableFrom(interceptorType.type))
            {
                interceptorType.runType = EnumInterceptorRunType.After;
            }
            else if (typeof(IBeforeInterceptor).IsAssignableFrom(interceptorType.type))
            {
                interceptorType.runType = EnumInterceptorRunType.Before;
            }
            else if (typeof(IExceptionInterceptor).IsAssignableFrom(interceptorType.type))
            {
                interceptorType.runType = EnumInterceptorRunType.Exception;
            }

            return(interceptorType);
        }
Exemplo n.º 2
0
 /// <summary>
 ///  The proxy client does not use any interceptor
 /// </summary>
 public void On(InterceptorBase interceptorBase)
 {
 }
 /// <summary>
 ///  The proxy client does not use any interceptor
 /// </summary>
 public void SetInterceptor(InterceptorBase interceptorBase)
 {
 }