protected ConfigPropertyBase(IPropertyConfigBase config, [NotNull] String key, ICryptKey cryptKey, ConfigPropertyOptions options, IEnumerable <String> sections) { Config = config; Key = key ?? throw new ArgumentNullException(nameof(key)); CryptKey = cryptKey; Sections = sections.AsIImmutableList(); Options = options; }
IReadOnlyConfigProperty <T> IReadOnlyPropertyConfig.GetProperty <T>(String key, T value, Func <T, Boolean> validate, ICryptKey crypt, ConfigPropertyOptions options, TryConverter <String, T> converter, IEnumerable <String> sections) { return(GetProperty(key, value, validate, crypt, options, converter, sections)); }
public virtual IConfigProperty <T> GetProperty <T>(String key, T value, Func <T, Boolean> validate, ICryptKey crypt, ConfigPropertyOptions options, TryConverter <String, T> converter, IEnumerable <String> sections) { IImmutableList <String> materialized = sections.AsIImmutableList(); return(GetOrAddProperty <T>(this, key, materialized, () => new ConfigProperty <T>(this, key, value, validate, crypt, options, converter, materialized))); }
protected internal ConfigProperty(IPropertyConfig config, [NotNull] String key, T defaultValue, Func <T, Boolean> validate, ICryptKey crypt, ConfigPropertyOptions options, TryConverter <String, T> converter, IEnumerable <String> sections) : base(config, key ?? throw new ArgumentNullException(nameof(key)), crypt, options, sections) { Config = config ?? throw new ArgumentNullException(nameof(config)); DefaultValue = defaultValue; Validate = validate; Converter = converter ?? ConvertUtils.TryConvert; }