Azavea.Open.Common.Config.GetParameterWithSubstitution C# (CSharp) Method

GetParameterWithSubstitution() public method

Similar to the regular GetParameter method, except it will substitute environment variables in the values if present.
public GetParameterWithSubstitution ( string component, string parameter, bool tolerant ) : string
component string The component or section of the config file, used to /// locate the parameter.
parameter string The name of the config parameter.
tolerant bool If true, this method logs warnings for unmatched environment /// variables. If false, it throws exceptions.
return string
        public string GetParameterWithSubstitution(string component, string parameter, bool tolerant)
        {
            string value = GetParameter(component, parameter);
            return ReplaceEnvironmentVariables(value, tolerant);
        }

Same methods

Config::GetParameterWithSubstitution ( string component, string parameter, bool tolerant, string defaultValue ) : string

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// Populates the descriptor's values from a config file.
 /// </summary>
 /// <param name="config">Config to get params from.</param>
 /// <param name="component">Section of the config XML to look in for db params.</param>
 /// <param name="decryptionDelegate">Delegate to call to decrypt password fields.
 ///                                  May be null if passwords are in plain text.</param>
 public CsvDescriptor(Config config, string component,
     ConnectionInfoDecryptionDelegate decryptionDelegate)
     : this(CsvConnectionType.Unknown,
            config.GetParameterWithSubstitution(component, "Path", true),
            null, null,
            config.ParameterExists(component, "OutputQuoteLevel")
                ? (CsvQuoteLevel) Enum.Parse(typeof (CsvQuoteLevel),config.GetParameter(component, "OutputQuoteLevel"))
                : CsvQuoteLevel.QuoteStrings)
 {
 }
All Usage Examples Of Azavea.Open.Common.Config::GetParameterWithSubstitution