async Task UpdateServerAsync(Server server, string username, string password, int port, Func <SshClient, CancellationToken, Task> action, CancellationToken ct) { appReduxDispatcher.Dispatch(new StartUpdatingServerAction(server.Key)); try { using (SshClient client = new SshClient(server.Url, port, username, password)) { ct.ThrowIfCancellationRequested(); client.Connect(); ct.ThrowIfCancellationRequested(); if (action != null) { await action(client, ct).ConfigureAwait(false); } appReduxDispatcher.Dispatch(new ServerUpdateSuccessAction(server.Key)); } } catch (Exception ex) { appReduxDispatcher.Dispatch(new ServerUpdateFailureAction(server.Key, ex.Message)); } }
void ToggleShowPassword() { appReduxDispatcher.Dispatch(new ToggleShowPasswordAction()); }