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)); }
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)); } }