コード例 #1
0
		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;
		}
コード例 #2
0
ファイル: SemanticAnalizerStep.cs プロジェクト: atczyc/castle
		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" );
			}
		}