/// <summary> /// Sets the CSLG credentials for the specified connection. /// </summary> /// <param name="connection">The connection that the credentials are for.</param> /// <param name="credentials">The credentials to be stored.</param> public static void SetCslgCredentials(IXenConnection connection, CslgCredentials credentials) { Program.AssertOnEventThread(); Util.ThrowIfParameterNull(connection, "connection"); Util.ThrowIfParameterNull(credentials, "credentials"); Pool pool = Helpers.GetPoolOfOne(connection); if (pool != null) { Dictionary <string, CslgCredentials> allStoredCredentials = ReadCslgCredentials(); allStoredCredentials[pool.opaque_ref] = credentials; SaveCslgCredentials(allStoredCredentials); } }
public override bool Equals(object obj) { CslgCredentials other = obj as CslgCredentials; return(other != null && other.Host == Host && other.Username == Username && other.PasswordSecret == PasswordSecret); }
/// <summary> /// Sets the CSLG credentials for the specified connection. /// </summary> /// <param name="connection">The connection that the credentials are for.</param> /// <param name="credentials">The credentials to be stored.</param> public static void SetCslgCredentials(IXenConnection connection, CslgCredentials credentials) { Program.AssertOnEventThread(); Util.ThrowIfParameterNull(connection, "connection"); Util.ThrowIfParameterNull(credentials, "credentials"); Pool pool = Helpers.GetPoolOfOne(connection); if (pool != null) { Dictionary<string, CslgCredentials> allStoredCredentials = ReadCslgCredentials(); allStoredCredentials[pool.opaque_ref] = credentials; SaveCslgCredentials(allStoredCredentials); } }