protected IMethodInterceptor[] CreateInterceptor(InterceptorDefinitionCollection advices) { IMethodInterceptor[] interceptors = new IMethodInterceptor[advices.Count]; for (int i = 0; i < interceptors.Length; i++) { Type adviceType = advices[i].TypeReference.ResolvedType; interceptors[i] = ObtainInterceptorInstance(adviceType); } return interceptors; }
private void CheckAdvices(InterceptorDefinitionCollection advices) { IDictionary advicesDefined = new Hashtable(); foreach(InterceptorDefinition advice in advices) { if (advice.TypeReference.TargetType == TargetTypeEnum.Link) { AssertKeyExists( _globalInterceptors, advice, advice.TypeReference.LinkRef, "The referenced interceptor is not declared in the global interceptor section" ); } AssertUnique( advicesDefined, advice, advice.TypeReference.ToString(), "Duplicated advices found" ); } }