Esempio n. 1
0
        public override void PostBuildUp(IBuilderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (!(context.Existing is IInterceptingProxy))
            {
                var typeToIntercept = context.OriginalBuildKey.Type;

                // only intercept profiling for public interface types
                if (!typeToIntercept.IsInterface || typeToIntercept.IsNotPublic)
                {
                    return;
                }

                if (_filter != null && _filter.ShouldBeProfiled(typeToIntercept))
                {
                    context.Existing = Intercept.ThroughProxy(
                        typeToIntercept, context.Existing, new InterfaceInterceptor(), new[] { _deepProfilingBehavior });
                }
            }
        }