示例#1
0
 private static void FlagLastInterceptor(PseudoInterceptor lastInterceptor)
 {
     if (lastInterceptor != null)
     {
         lastInterceptor.ShouldProceed = true;
     }
 }
示例#2
0
 private static void FlagLastInterceptor(PseudoInterceptor lastInterceptor)
 {
     if (lastInterceptor != null)
     {
         lastInterceptor.ShouldProceed = true;
     }
 }
示例#3
0
        /// <summary>
        /// Creates a proxy around an instance with pseudo (empty) interceptors.
        /// </summary>
        /// <param name="proxy">The proxy.</param>
        /// <param name="interfaceType">Type of the interface.</param>
        /// <param name="instanceToWrap">The instance to wrap.</param>
        /// <returns></returns>
        public static object CreatePseudoProxy(IMasterProxy proxy, Type interfaceType, object instanceToWrap)
        {
            var pseudoList = new IInterceptor[proxy.Configuration.Interceptors.Count];
            pseudoList[0] = proxy;

            for(var i = 1; i < pseudoList.Length; i++) {
                pseudoList[i] = new PseudoInterceptor();
            }

            return CreateProxy(interfaceType, instanceToWrap, pseudoList);
        }