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

GetParameter() public method

Similar to GetParameter, except rather than throwing an exception if a parameter doesn't exist, returns the default value.
public GetParameter ( string component, string parameter, string defaultValue ) : string
component string The component or section of the config file, used to /// locate the parameter.
parameter string The name of the config parameter.
defaultValue string Value to return if the parameter doesn't exist.
return string
        public string GetParameter(string component, string parameter, string defaultValue)
        {
            if (ParameterExists(component, parameter))
            {
                return GetParameter(component, parameter);
            }
            return defaultValue;
        }

Same methods

Config::GetParameter ( string component, string parameter ) : string

Usage Example

Ejemplo n.º 1
0
 public OdpSdeStDescriptor(Config config, string component, ConnectionInfoDecryptionDelegate decryptionDelegate)
     : base(config.GetParameter(component, "Server", null),
            config.GetParameter(component, "User", null),
            GetDecryptedConfigParameter(config, component, "Password", decryptionDelegate),
            config.GetParameterAsInt(component, "Connect_Timeout", null))
 {
 }
All Usage Examples Of Azavea.Open.Common.Config::GetParameter