/// <summary>
        /// Initializes a new instance of the <see cref="OpenGenericDecoratorRegistrationSource"/> class.
        /// </summary>
        /// <param name="registrationData">The registration data for the open generic.</param>
        /// <param name="existingPipelineBuilder">The pipeline for the existing open generic registration.</param>
        /// <param name="activatorData">The activator data.</param>
        public OpenGenericDecoratorRegistrationSource(
            RegistrationData registrationData,
            IResolvePipelineBuilder existingPipelineBuilder,
            OpenGenericDecoratorActivatorData activatorData)
        {
            if (registrationData == null)
            {
                throw new ArgumentNullException(nameof(registrationData));
            }

            if (activatorData == null)
            {
                throw new ArgumentNullException(nameof(activatorData));
            }

            OpenGenericServiceBinder.EnforceBindable(activatorData.ImplementationType, registrationData.Services);

            if (registrationData.Services.Contains((Service)activatorData.FromService))
            {
                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, OpenGenericDecoratorRegistrationSourceResources.FromAndToMustDiffer, activatorData.FromService));
            }

            _registrationData = registrationData;
            _activatorData    = activatorData;
            _existingPipeline = existingPipelineBuilder;
        }
 public OpenGenericRegistrationSource(RegistrationData registrationData, ReflectionActivatorData activatorData)
 {
     if (registrationData == null)
     {
         throw new ArgumentNullException("registrationData");
     }
     if (activatorData == null)
     {
         throw new ArgumentNullException("activatorData");
     }
     OpenGenericServiceBinder.EnforceBindable(activatorData.ImplementationType, registrationData.Services);
     this._registrationData = registrationData;
     this._activatorData    = activatorData;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenGenericRegistrationSource"/> class.
        /// </summary>
        /// <param name="registrationData">The registration data for the open generic.</param>
        /// <param name="existingPipelineBuilder">The pipeline for the existing open generic registration.</param>
        /// <param name="activatorData">The activator data.</param>
        public OpenGenericRegistrationSource(
            RegistrationData registrationData,
            IResolvePipelineBuilder existingPipelineBuilder,
            ReflectionActivatorData activatorData)
        {
            if (registrationData == null)
            {
                throw new ArgumentNullException(nameof(registrationData));
            }

            if (activatorData == null)
            {
                throw new ArgumentNullException(nameof(activatorData));
            }

            OpenGenericServiceBinder.EnforceBindable(activatorData.ImplementationType, registrationData.Services);

            _registrationData        = registrationData;
            _existingPipelineBuilder = existingPipelineBuilder;
            _activatorData           = activatorData;
        }
示例#4
0
        public OpenGenericDecoratorRegistrationSource(
            RegistrationData registrationData,
            OpenGenericDecoratorActivatorData activatorData)
        {
            if (registrationData == null)
            {
                throw new ArgumentNullException("registrationData");
            }
            if (activatorData == null)
            {
                throw new ArgumentNullException("activatorData");
            }

            OpenGenericServiceBinder.EnforceBindable(activatorData.ImplementationType, registrationData.Services);

            if (registrationData.Services.Contains((Service)activatorData.FromService))
            {
                throw new ArgumentException(string.Format(
                                                OpenGenericDecoratorRegistrationSourceResources.FromAndToMustDiffer, activatorData.FromService));
            }

            _registrationData = registrationData;
            _activatorData    = activatorData;
        }