private LazuriteClient CreateClient(ConnectionCredentials credentials) { var client = new LazuriteClient( credentials.Host, credentials.Port, true, credentials.SecretKey, credentials.Login, credentials.Password, TimeSpan.FromMinutes(ConnectionTimeout_Minutes)); client.Client.ConnectionError += (o, e) => { ConnectionStateChanged?.Invoke(this, new ConnectionStateChangedEventArgs(client, false, credentials)); Debug.WriteLine(e); }; client.Client.ConnectionNormal += (o, e) => ConnectionStateChanged?.Invoke(this, new ConnectionStateChangedEventArgs(client, true, credentials)); return(client); }
public ConnectionStateChangedEventArgs(LazuriteClient client, bool isConnected, ConnectionCredentials credentials) : base(isConnected) { Client = client; Credentials = credentials; }