www.pudn.com > Websharp2005.rar > AspectInfo.cs


using System;  
using System.Collections;  
  
namespace Websharp.Aspect  
{  
	///   
	/// 描述Aspect配置信息的类  
	///   
	internal class AspectInfo  
	{  
		public AspectInfo(string assemblyName,string className,string deployModell,string pointCutType,  
							string actionPosition,string matchClass,string matchMethod,string matchPattern)  
		{  
			AssemblyName=assemblyName;	  
			ClassName=className;  
			DeployModell=deployModell;  
			PointCutType=pointCutType;  
			ActionPosition=actionPosition;  
			MatchClass=matchClass;  
			MatchMethod=matchMethod;  
			MatchPattern=matchPattern;  
			if(DeployModell.Equals("Singleton"))  
			{  
				SingletonAspect=Activator.CreateInstance(AssemblyName,ClassName).Unwrap() as IAspect;  
							  
			}  
		}  
		  
		///   
		/// Aspect所在的程序集名称  
		///   
		public string AssemblyName="";	  
		///   
		/// Aspect的类名  
		///   
		public string ClassName="";  
		///   
		/// Aspect部署模式,有Singleton和MultiInstance两种模式  
		///   
		public string DeployModell="";  
		///   
		/// 拦截的类型,方法(Method)、构造函数(Construction)和属性(Property),不过目前对Property的拦截等同于Method  
		///   
		public string PointCutType="";  
		///   
		/// 拦截位置的类型,有Before,After和Both  
		///   
		public string ActionPosition="";  
		///   
		/// 被拦截类的表达式  
		///   
		public string MatchClass="";  
		///   
		/// 被拦截方法的表达式  
		///   
		public string MatchMethod="";  
		///   
		/// 拦截的表达式  
		///   
		public string MatchPattern="";  
		///   
		/// 当该Aspect是Singleton的时候,表示该Aspect对象  
		///   
		public IAspect SingletonAspect;  
	}  
  
	///   
	/// 表示AspectInfo的集合  
	///   
	internal class AspectInfoCollection : ArrayList  
	{  
		public new AspectInfo this[int i]  
		{  
			get{return base[i] as AspectInfo;}  
		}  
	}  
}