/// <summary> /// Initializes a new instance of the <see cref="AuthenticateServerOperation"/> class. /// </summary> /// <param name="username"> /// The username. /// </param> /// <param name="password"> /// The password. /// </param> /// <param name="requestServerInformation"> /// if set to <c>true</c> [request server information]. /// </param> /// <param name="requestSessionInformation"> /// if set to <c>true</c> [request session information]. /// </param> /// <param name="languageKey"> /// The language key. /// </param> /// <param name="theDelegate"> /// The delegate. /// </param> public AuthenticateServerOperation( string username, string password, bool requestServerInformation, bool requestSessionInformation, string languageKey, IAuthenticateServerOperationDelegate theDelegate) { var parameters = new Dictionary <string, string> { { "Service", "Authenticate" }, { "Method", "Logon" }, { "ClientVersion", Clientversion } }; if (!string.IsNullOrWhiteSpace(username)) { parameters["UserName"] = username; } if (!string.IsNullOrWhiteSpace(password)) { parameters["Password"] = password; } parameters["Language"] = string.IsNullOrWhiteSpace(languageKey) ? string.Empty : languageKey; parameters["ServerInfo"] = requestServerInformation ? "1" : "0"; parameters["SessionInfo"] = requestSessionInformation ? "1" : "0"; this.ParameterDictionary = parameters; this.Delegate = theDelegate; this.AlwaysPerform = true; }
/// <summary> /// Initializes a new instance of the <see cref="RevolutionAuthenticationServerOperation"/> class. /// </summary> /// <param name="cookies"> /// The cookies. /// </param> /// <param name="requestServerInformation"> /// The request server information. /// </param> /// <param name="requestSessionInformation"> /// The request session information. /// </param> /// <param name="languageKey"> /// The language key. /// </param> /// <param name="theDelegate"> /// The the delegate. /// </param> public RevolutionAuthenticationServerOperation( List <Cookie> cookies, bool requestServerInformation, bool requestSessionInformation, string languageKey, IAuthenticateServerOperationDelegate theDelegate) { this.cookies = cookies; var parameters = new Dictionary <string, string> { { "Service", "Authenticate" }, { "Method", "RASLogon" }, { "ClientVersion", Clientversion } }; parameters["Language"] = string.IsNullOrWhiteSpace(languageKey) ? string.Empty : languageKey; parameters["ServerInfo"] = requestServerInformation ? "1" : "0"; parameters["SessionInfo"] = requestSessionInformation ? "1" : "0"; this.ParameterDictionary = parameters; this.Delegate = theDelegate; this.AlwaysPerform = true; }