private static async Task MainAsync( string[] args ) { var arguments = Arguments.Parse( args ); var api = new ClientApi(arguments.Server); Func<int, string, Task> _; switch ( arguments.Action ) { case ProcessAction.Start: _ = api.Process.Start; break; case ProcessAction.Stop: _ = api.Process.Stop; break; case ProcessAction.Restart: _ = api.Process.Restart; break; default: throw new ArgumentOutOfRangeException(); } await _( arguments.Process, arguments.Key ).ConfigureAwait( false ); }
internal ClientProcessMethods( ClientApi api ) : base( api.Server, "Client/Process/" ) { _api = api; }
private async Task Connect( string server ) { _api = new ClientApi( server ); _keys = new Dictionary<int, string>(); await UpdateServers().ConfigureAwait( true ); }