Ejemplo n.º 1
0
        /// <summary>
        /// Wrap a given ImplementationType
        /// </summary>
        /// <param name="type">A valid ImplementationType</param>
        /// <param name="iftFactory"></param>
        /// <param name="implTypeChecker"></param>
        /// <exception cref="ArgumentOutOfRangeException">if <paramref name="type"/> doesn't
        /// fulfill all constraints</exception>
        /// <exception cref="ArgumentNullException">if <paramref name="type"/> is null</exception>
        protected ImplementationType(Type type, InterfaceType.Factory iftFactory, IImplementationTypeChecker implTypeChecker)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }
            if (iftFactory == null)
            {
                throw new ArgumentNullException("iftFactory");
            }
            if (implTypeChecker == null)
            {
                throw new ArgumentNullException("implTypeChecker");
            }
            if (!implTypeChecker.IsImplementationType(type))
            {
                throw new ArgumentOutOfRangeException("type", String.Format("Type {0} is not an ImplementationType", type.AssemblyQualifiedName));
            }

            this._type       = type;
            this._iftFactory = iftFactory;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Wrap a given ImplementationType
        /// </summary>
        /// <param name="type">A valid ImplementationType</param>
        /// <param name="iftFactory"></param>
        /// <param name="implTypeChecker"></param>
        /// <exception cref="ArgumentOutOfRangeException">if <paramref name="type"/> doesn't 
        /// fulfill all constraints</exception>
        /// <exception cref="ArgumentNullException">if <paramref name="type"/> is null</exception>
        protected ImplementationType(Type type, InterfaceType.Factory iftFactory, IImplementationTypeChecker implTypeChecker)
        {
            if (type == null) throw new ArgumentNullException("type");
            if (iftFactory == null) throw new ArgumentNullException("iftFactory");
            if (implTypeChecker == null) throw new ArgumentNullException("implTypeChecker");
            if (!implTypeChecker.IsImplementationType(type)) { throw new ArgumentOutOfRangeException("type", String.Format("Type {0} is not an ImplementationType", type.AssemblyQualifiedName)); }

            this._type = type;
            this._iftFactory = iftFactory;
        }