public GetParameter ( string component, string parameter ) : string | ||
component | string | The component or section of the config file, used to /// locate the parameter. |
parameter | string | The name of the config parameter. |
Результат | string |
public string GetParameter(string component, string parameter)
{
if (component == null)
{
throw new ArgumentNullException("component", "Component cannot be null. Parameter was '" +
parameter + "'.");
}
if (parameter == null)
{
throw new ArgumentNullException("parameter", "Parameter cannot be null. Component was '" +
component + "'.");
}
try
{
return _paramsByComponent[component][parameter];
}
catch (Exception ex)
{
ReThrowException("Unable to read parameter.",
new object[] { ConfigFile, component, parameter }, ex);
// that throws, but the compiler wants a return statement.
return "never gets here";
}
}
Config::GetParameter ( string component, string parameter, string defaultValue ) : string |
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)) { }