コード例 #1
0
ファイル: Updater.cs プロジェクト: MihaMarkic/AutoMasshTik
 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));
     }
 }
コード例 #2
0
 void ToggleShowPassword()
 {
     appReduxDispatcher.Dispatch(new ToggleShowPasswordAction());
 }