示例#1
0
		public void Initialize(IObjectFactory factory)
		{
			if (!TraceAll && EnabledAspects.Count == 0)
				return;
			DisabledAspects.Add(typeof(ICloneable));
			DisabledAspects.Add(typeof(ISerializable));

			var performance = new PerformanceInterceptor();
			var registrator = factory.Resolve<IInterceptorRegistrator>();
			if (TraceAll)
				registrator.Intercept(t => !DisabledAspects.Contains(t), performance);
			else
				EnabledAspects.ForEach(it => registrator.Intercept(it, performance));
		}
示例#2
0
        public void Initialize(IObjectFactory factory)
        {
            if (!TraceAll && EnabledAspects.Count == 0)
            {
                return;
            }
            DisabledAspects.Add(typeof(ICloneable));
            DisabledAspects.Add(typeof(ISerializable));

            var performance = new PerformanceInterceptor();
            var registrator = factory.Resolve <IInterceptorRegistrator>();

            if (TraceAll)
            {
                registrator.Intercept(t => !DisabledAspects.Contains(t), performance);
            }
            else
            {
                EnabledAspects.ForEach(it => registrator.Intercept(it, performance));
            }
        }