コード例 #1
0
        /// <summary>Adds the per request part.</summary>
        /// <param name="interfaceType">Type of the interface.</param>
        /// <param name="implementationType">Type of the implementation.</param>
        /// <param name="name">The name.</param>
        /// <returns><c>true</c> if the part has been added.</returns>
        protected bool AddPerRequestPart(Type interfaceType, Type implementationType, string name)
        {
            RemovePart(implementationType, name);

            var description = new PartDescription(interfaceType, implementationType, name, true);

            _parts.Add(description);

            return(true);
        }
コード例 #2
0
        /// <summary>Adds a part for a given interface, implementation type and name.</summary>
        /// <param name="interfaceType">Type of the interface.</param>
        /// <param name="implementationType">Type of the implementation.</param>
        /// <param name="name">The name.</param>
        /// <param name="part">The part.</param>
        /// <returns><c>true</c> if the part has been added.</returns>
        protected bool AddPart(Type interfaceType, Type implementationType, string name, object part)
        {
            RemovePart(implementationType, name);

            var description = new PartDescription(interfaceType, implementationType, name, false);

            if (part != null)
            {
                description.SetPart(this, part);
            }
            _parts.Add(description);

            return(true);
        }