示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TypeResolverNodeFactory"/> class.
        /// </summary>
        /// <param name="expectedTypes">The expected types.</param>
        /// <param name="factorySettings">The factory settings to use.</param>
        /// <exception cref="System.ArgumentNullException">expectedTypes</exception>
        public TypeResolverNodeFactory(IEnumerable <Type> expectedTypes, FactorySettings factorySettings = null)
            : base(factorySettings)
        {
            if (expectedTypes == null)
            {
                throw new ArgumentNullException("expectedTypes");
            }

            this._expectedTypes = expectedTypes.ToArray();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultNodeFactory"/> class.
        /// </summary>
        /// <param name="types">The types.</param>
        /// <param name="factorySettings">The factory settings to use.</param>
        /// <exception cref="System.ArgumentNullException">types</exception>
        /// <exception cref="System.ArgumentException">types</exception>
        public DefaultNodeFactory(IEnumerable <Type> types, FactorySettings factorySettings = null)
        {
            if (types == null)
            {
                throw new ArgumentNullException("types");
            }

            this._types = types.ToArray();
            if (this._types.Any(t => t == null))
            {
                throw new ArgumentException("types");
            }

            this._factorySettings = factorySettings ?? new FactorySettings();
            this._innerFactory    = this.CreateFactory();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultNodeFactory"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="factorySettings">The factory settings to use.</param>
 public DefaultNodeFactory(Type type, FactorySettings factorySettings = null)
     : this(new [] { type }, factorySettings)
 {
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeFactory"/> class.
 /// </summary>
 /// <param name="factorySettings">The factory settings to use.</param>
 public NodeFactory(FactorySettings factorySettings)
 {
     this._factorySettings = factorySettings ?? new FactorySettings();
 }