Ejemplo n.º 1
0
        /// <summary>
        /// 调用结果
        /// </summary>
        public IMethodReturn Invoke(IMethodInvocation input, InvokeInterceptorDelegate target)
        {
            if (this.Count == 0)
                return target(input, null);

            int index = 0;

            IMethodReturn result = _interceptors[0].Invoke(input, delegate {
                ++index;
                if (index < this.Count) {
                    return _interceptors[index].Invoke;
                }
                else {
                    return target;
                }
            });

            return result;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 调用结果
        /// </summary>
        public IMethodReturn Invoke(IMethodInvocation input, InvokeInterceptorDelegate target)
        {
            if (this.Count == 0)
                return target(input, null);

            int index = 0;

            IMethodReturn result = _interceptors[0].Invoke(input, delegate {
                ++index;
                if (index < this.Count) {
                    return _interceptors[index].Invoke;
                }
                else {
                    return target;
                }
            });

            return result;
        }