Esempio n. 1
0
 /// <summary>
 /// Builds the force directory value.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <returns></returns>
 public IConfigurationValue BuildForceDirectoryValue(string name)
 {
     IConfigurationValue configValue = new AppSettingsConfigurationValue(this._Provider, name);
     configValue = new RequiredValueDecorator(configValue);
     configValue = new ForceDirectoryValueDecorator(configValue);
     configValue = new DirectoryExistsValueDecorator(configValue);
     configValue = new ErrorReportingValueDecorator(configValue);
     return configValue;
 }
Esempio n. 2
0
 /// <summary>
 /// Builds the value converter.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="required">if set to <c>true</c> [required].</param>
 /// <param name="type">The type.</param>
 /// <param name="defaultValue">The default value.</param>
 /// <returns></returns>
 public IConfigurationValue BuildValueConverter(string name, bool required, Type type, object defaultValue = null)
 {
     IConfigurationValue configValue = new AppSettingsConfigurationValue(this._Provider, name);
     if (required)
     {
         configValue = new RequiredValueDecorator(configValue);
     }
     configValue = new GenericConverterValueDecorator(configValue, type, defaultValue);
     configValue = new ErrorReportingValueDecorator(configValue);
     return configValue;
 }