/// <summary>
        /// Add policies to the <paramref name="policies"/> to configure the container to use the represented
        /// <see cref="Type"/> as an additional interface for the supplied parameters.
        /// </summary>
        /// <param name="serviceType">Interface being registered.</param>
        /// <param name="implementationType">Type to register.</param>
        /// <param name="name">Name used to resolve the type object.</param>
        /// <param name="policies">Policy list to add policies to.</param>
        public override void AddPolicies(Type serviceType, Type implementationType, string name, IPolicyList policies)
        {
            AdditionalInterfacesPolicy policy =
                AdditionalInterfacesPolicy.GetOrCreate(policies, implementationType, name);

            policy.AddAdditionalInterface(this.additionalInterface);
        }
 internal static AdditionalInterfacesPolicy GetOrCreate(
     IPolicyList policies,
     Type typeToCreate,
     string name)
 {
     NamedTypeBuildKey key = new NamedTypeBuildKey(typeToCreate, name);
     IAdditionalInterfacesPolicy policy =
         policies.GetNoDefault<IAdditionalInterfacesPolicy>(key, false);
     if ((policy == null) || !(policy is AdditionalInterfacesPolicy))
     {
         policy = new AdditionalInterfacesPolicy();
         policies.Set<IAdditionalInterfacesPolicy>(policy, key);
     }
     return (AdditionalInterfacesPolicy)policy;
 }
        internal static AdditionalInterfacesPolicy GetOrCreate(
            IPolicyList policies,
            Type typeToCreate,
            string name)
        {
            NamedTypeBuildKey           key    = new NamedTypeBuildKey(typeToCreate, name);
            IAdditionalInterfacesPolicy policy =
                policies.GetNoDefault <IAdditionalInterfacesPolicy>(key, false);

            if ((policy == null) || !(policy is AdditionalInterfacesPolicy))
            {
                policy = new AdditionalInterfacesPolicy();
                policies.Set <IAdditionalInterfacesPolicy>(policy, key);
            }
            return((AdditionalInterfacesPolicy)policy);
        }