...
Code Block |
---|
|
Description("This indicates if Proxy settings should be read from the system or not. This takes precedence over other proxy settings."), DisplayName("Proxy Auto Detect"), DefaultValue("True")]
public bool ProxyUseSystem
{
get
{
if (ContainsKey(proxyUseSystemToken))
{
return (bool)this[proxyUseSystemToken];
}
return false;
}
set
{
this[proxyUseSystemToken] = value;
}
}
[DisplayName("Proxy Password"), PasswordPropertyText(true), DefaultValue(""), Description("A password if authentication is to be used for the proxy.")]
public string ProxyPassword
{
get
{
if (ContainsKey(proxyPasswordToken))
{
return (string)this[proxyPasswordToken];
}
return null;
}
set
{
this[proxyPasswordToken] = value;
}
}
/// <summary>
/// The TCP port for the proxy server (defaults to 80).
/// </summary>
[DefaultValue(""),Description("The TCP port for the proxy ProxyServer (default 80)."), DisplayName("Proxy Port")]
public int ProxyPort
{
get
{
if(this.ContainsKey(proxyPortToken))
{
int port = 80;
if (int.TryParse((string)this[proxyPortToken], out port))
{
return port;
}
else
{
Logging.Error(typeof(SalesforceSession), "Failed to parse Proxy Port from [" + this[proxyPortToken] + "]");
}
}
return 80;
}
set
{
this[proxyPortToken] = value;
}
}
[DefaultValue(""), DisplayName("Proxy Server"), Description("If a proxy Server is given, then the HTTP request is sent to the proxy instead of the server otherwise specified.")]
public string ProxyServer
{
get
{
if (ContainsKey(proxyServerToken))
{
return (string)this[proxyServerToken];
}
return null;
}
set
{
this[proxyServerToken] = value;
}
}
[Description("The ssl type to use when connecting to the proxy server (default: AUTO)."), DisplayName("Proxy SSL Type"), DefaultValue("")]
internal string ProxySSLType
{
get;
set;
}
[DefaultValue(""), DisplayName("Proxy User"), Description("A user name, if authentication is to be used for the proxy.")]
public string ProxyUser
{
get
{
if (ContainsKey(proxyUserNameToken))
{
return (string)this[proxyUserNameToken];
}
return null;
}
set
{
this[proxyUserNameToken] = value;
}
} |
3) Salesforce sessions using the Proxy can be established using the connection string
Code Block |
---|
|
public LoginDetails(string connectionString)
{
if (string.IsNullOrEmpty(connectionString))
{
throw new System.Configuration.ConfigurationErrorsException("Null or empty connection string");
}
this._connectionStringBuilder = new Data.SalesforceConnectionStringBuilder(connectionString);
} |