Ejemplo n.º 1
0
        /// <summary>
        /// Create a totally customized Config instance.
        /// Generally you will not need this constructor.
        /// </summary>
        /// <param name="cache">The <see cref="IValueCache"/> instance to be used by this Config instance.</param>
        /// <param name="source">The <see cref="IValueSource"/> instance to be used by this Config instance.</param>
        /// <param name="transformer">The <see cref="IValueTransformer"/> instance to be used by this Config instance.</param>
        /// <param name="validator">The <see cref="IValueValidator"/> instance to be used by this Config instance.</param>
        /// <param name="coercer">The <see cref="IValueCoercer"/> instance to be used by this Config instance.</param>
        protected Config(IValueCache cache, IValueSource source, IValueTransformer transformer, IValueValidator validator, IValueCoercer coercer)
        {
            Cache       = cache;
            Source      = source;
            Transformer = transformer;
            Validator   = validator;
            Coercer     = coercer;

            // Pre-cache all the properties on this instance
            _properties = GetType()
                          .GetMembers(BindingFlags.Instance | BindingFlags.Public)
                          .OfType <PropertyInfo>()
                          .Where(p => p.CanRead)
                          .ToDictionary(p => p.Name);
        }
Ejemplo n.º 2
0
 public ConfigWrapper(IValueCache cache, IValueSource source, IValueTransformer transformer, IValueValidator validator, IValueCoercer coercer)
     : base(cache, source, transformer, validator, coercer)
 {
 }