private void AddDefaultTypeInterceptor(Type typeToIntercept, IPolicyList policies) { ITypeInterceptionPolicy policy; if (_interceptor != null) { policy = new FixedTypeInterceptionPolicy((ITypeInterceptor)_interceptor); } else { policy = new ResolvedTypeInterceptionPolicy(_interceptorKey); } policies.Set(policy, typeToIntercept); }
private void AddDefaultTypeInterceptor <TPolicySet>(ref TPolicySet policies) where TPolicySet : IPolicySet { ITypeInterceptionPolicy policy; if (_interceptor != null) { policy = new FixedTypeInterceptionPolicy((ITypeInterceptor)_interceptor); } else { policy = new ResolvedTypeInterceptionPolicy(_interceptorKey); } policies.Set(typeof(ITypeInterceptionPolicy), policy); }