コード例 #1
0
        /// <summary>
        /// Adds a catalog wide interceptor. If adding more than one catalog wide interceptor,
        /// it is wrapped in <see cref="CompositeValueInterceptor"/> instance.
        /// </summary>
        /// <param name="interceptor">Interceptor to be added.</param>
        /// <returns><see cref="InterceptionConfiguration"/> instance to enable fluent configuration.</returns>
        public InterceptionConfiguration AddInterceptor(IExportedValueInterceptor interceptor)
        {
            if (interceptor == null) throw new ArgumentNullException("interceptor");

            this.interceptors.Add(interceptor);
            return this;
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PredicateInterceptionCriteria"/> class.
        /// </summary>
        /// <param name="interceptor">The <see cref="IExportedValueInterceptor"/> instance.</param>
        /// <param name="predicate">The predicate.</param>
        public PredicateInterceptionCriteria(IExportedValueInterceptor interceptor, Func<ComposablePartDefinition, bool> predicate)
        {
            if (interceptor == null) throw new ArgumentNullException("interceptor");
            if (predicate == null) throw new ArgumentNullException("predicate");

            Interceptor = interceptor;
            Predicate = predicate;
        }
コード例 #3
0
        public InterceptingComposablePartDefinition(ComposablePartDefinition interceptedPartDefinition, IExportedValueInterceptor valueInterceptor)
        {
            interceptedPartDefinition.ShouldNotBeNull("interceptedPartDefinition");
            valueInterceptor.ShouldNotBeNull("valueInterceptor");

            InterceptedPartDefinition = interceptedPartDefinition;
            _valueInterceptor = valueInterceptor;
        }
コード例 #4
0
        public InterceptingComposablePartDefinition(ComposablePartDefinition interceptedPartDefinition, IExportedValueInterceptor valueInterceptor)
        {
            if (interceptedPartDefinition == null) throw new ArgumentNullException("interceptedPartDefinition");
            if (valueInterceptor == null) throw new ArgumentNullException("valueInterceptor");

            InterceptedPartDefinition = interceptedPartDefinition;
            this.valueInterceptor = valueInterceptor;
        }
コード例 #5
0
        public InterceptingComposablePart(ComposablePart interceptedPart, IExportedValueInterceptor valueInterceptor)
        {
            if (interceptedPart == null) throw new ArgumentNullException("interceptedPart");
            if (valueInterceptor == null) throw new ArgumentNullException("valueInterceptor");

            InterceptedPart = interceptedPart;
            this.valueInterceptor = valueInterceptor;
            this.values = new Dictionary<ExportDefinition, object>();
        }
コード例 #6
0
        public InterceptingComposablePart(ComposablePart interceptedPart, IExportedValueInterceptor valueInterceptor)
        {
            interceptedPart.ShouldNotBeNull("interceptedPart");
            valueInterceptor.ShouldNotBeNull("valueInterceptor");

            InterceptedPart = interceptedPart;
            _valueInterceptor = valueInterceptor;
            _values = new Dictionary<ExportDefinition, object>();
        }
コード例 #7
0
 public InterceptingCatalog(ComposablePartCatalog interceptedCatalog, IExportedValueInterceptor valueInterceptor, IList<IExportHandler> handlers)
 {
     interceptedCatalog.ShouldNotBeNull("interceptedCatalog");
     valueInterceptor.ShouldNotBeNull("valueInterceptor)");
     _interceptedCatalog = interceptedCatalog;
     _valueInterceptor = valueInterceptor;
     _handlers = handlers;
     InitializeHandlers();
 }
コード例 #8
0
        /// <summary>
        /// Adds a catalog wide interceptor. If adding more than one catalog wide interceptor,
        /// it is wrapped in <see cref="CompositeValueInterceptor"/> instance.
        /// </summary>
        /// <param name="interceptor">Interceptor to be added.</param>
        /// <returns><see cref="InterceptionConfiguration"/> instance to enable fluent configuration.</returns>
        public InterceptionConfiguration AddInterceptor(IExportedValueInterceptor interceptor)
        {
            if (interceptor == null)
            {
                throw new ArgumentNullException("interceptor");
            }

            this.interceptors.Add(interceptor);
            return(this);
        }
コード例 #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PredicateInterceptionCriteria"/> class.
        /// </summary>
        /// <param name="interceptor">The <see cref="IExportedValueInterceptor"/> instance.</param>
        /// <param name="predicate">The predicate.</param>
        public PredicateInterceptionCriteria(IExportedValueInterceptor interceptor, Func <ComposablePartDefinition, bool> predicate)
        {
            if (interceptor == null)
            {
                throw new ArgumentNullException("interceptor");
            }
            if (predicate == null)
            {
                throw new ArgumentNullException("predicate");
            }

            Interceptor = interceptor;
            Predicate   = predicate;
        }
コード例 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InterceptingComposablePartDefinition"/> class.
        /// </summary>
        /// <param name="interceptedPartDefinition">The <see cref="ComposablePartDefinition"/> being intercepted.</param>
        /// <param name="valueInterceptor">The <see cref="IExportedValueInterceptor"/> instance.</param>
        public InterceptingComposablePartDefinition(ComposablePartDefinition interceptedPartDefinition, IExportedValueInterceptor valueInterceptor)
        {
            if (interceptedPartDefinition == null)
            {
                throw new ArgumentNullException("interceptedPartDefinition");
            }
            if (valueInterceptor == null)
            {
                throw new ArgumentNullException("valueInterceptor");
            }

            InterceptedPartDefinition = interceptedPartDefinition;
            this.valueInterceptor     = valueInterceptor;
        }
コード例 #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InterceptingComposablePart"/> class.
        /// </summary>
        /// <param name="interceptedPart">The <see cref="ComposablePart"/> being intercepted.</param>
        /// <param name="valueInterceptor">The <see cref="IExportedValueInterceptor"/> instance.</param>
        public InterceptingComposablePart(ComposablePart interceptedPart, IExportedValueInterceptor valueInterceptor)
        {
            if (interceptedPart == null)
            {
                throw new ArgumentNullException("interceptedPart");
            }
            if (valueInterceptor == null)
            {
                throw new ArgumentNullException("valueInterceptor");
            }

            InterceptedPart       = interceptedPart;
            this.valueInterceptor = valueInterceptor;
            this.values           = new Dictionary <ExportDefinition, object>();
        }
コード例 #12
0
 public LoggingInterceptionCriteria(IExportedValueInterceptor interceptor)
 {
     Interceptor = interceptor;
 }
コード例 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DisposableInterceptingComposablePart"/> class.
 /// </summary>
 /// <param name="interceptedPart">The <see cref="ComposablePart"/> being intercepted.</param>
 /// <param name="valueInterceptor">The <see cref="IExportedValueInterceptor"/> instance.</param>
 public DisposableInterceptingComposablePart(ComposablePart interceptedPart, IExportedValueInterceptor valueInterceptor)
     : base(interceptedPart, valueInterceptor)
 {
 }
コード例 #14
0
 public LoggingInterceptionCriteria(IExportedValueInterceptor interceptor)
 {
     Interceptor = interceptor;
 }
コード例 #15
0
 public DisposableInterceptingComposablePart(ComposablePart interceptedPart, IExportedValueInterceptor valueInterceptor)
     : base(interceptedPart, valueInterceptor)
 {
 }
コード例 #16
0
 public InterceptingCatalog(ComposablePartCatalog interceptedCatalog, IExportedValueInterceptor valueInterceptor)
     : this(interceptedCatalog, valueInterceptor, new List<IExportHandler>())
 {
 }