/// <summary>
        /// Add a new set of resolver override objects to the current build operation.
        /// </summary>
        /// <param name="newOverrides"><see cref="ResolverOverride"/> objects to add.</param>
        public void AddResolverOverrides(IEnumerable <ResolverOverride> newOverrides)
        {
            if (!this.ownsOverrides)
            {
                var sharedOverrides = this.resolverOverrides;
                this.resolverOverrides = new CompositeResolverOverride();
                this.resolverOverrides.AddRange(sharedOverrides);
                this.ownsOverrides = true;
            }

            resolverOverrides.AddRange(newOverrides);
        }
Пример #2
0
        public BuilderContext(IUnityContainer container, ILifetimeContainer lifetime, IStrategyChain chain,
                              IPolicyList persistentPolicies, IPolicyList policies, INamedType buildKey, object existing, params ResolverOverride[] resolverOverrides)
        {
            _chain    = chain;
            Container = container;
            Lifetime  = lifetime;
            Existing  = existing;

            OriginalBuildKey = buildKey;
            BuildKey         = OriginalBuildKey;

            Policies           = policies;
            PersistentPolicies = persistentPolicies;

            _ownsOverrides     = true;
            _resolverOverrides = new CompositeResolverOverride();
            if (null != resolverOverrides && 0 != resolverOverrides.Length)
            {
                _resolverOverrides.AddRange(resolverOverrides);
            }
        }
Пример #3
0
 public void AddResolverOverrides(IEnumerable <ResolverOverride> newOverrides)
 {
     resolverOverrides.AddRange(newOverrides);
 }