GetParameterAsInt() 공개 메소드

Similar to GetParameter, but converts the type for you (if possible, throws if not).
public GetParameterAsInt ( string component, string parameter ) : int
component string The component or section of the config file, used to /// locate the parameter.
parameter string The name of the config parameter.
리턴 int
예제 #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))
 {
 }
예제 #2
0
 /// <summary>
 /// This constructor reads all the appropriate 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 OleDbDescriptor(Config config, string component,
     ConnectionInfoDecryptionDelegate decryptionDelegate)
     : this(GetTypeFromConfig(config, component),
            config.GetParameter(component, "Provider", null),
            config.GetParameter(component, "Server", null),
            config.GetParameterWithSubstitution(component, "Database", true, null),
            config.GetParameter(component, "User", null),
            GetDecryptedConfigParameter(config, component, "Password", decryptionDelegate),
            config.GetParameterAsInt(component, "Connect_Timeout", null))
 {
 }