Пример #1
0
            protected override async Task <int> OnExecuteAuthenticatedAsync(QBittorrentClient client, CommandLineApplication app, IConsole console)
            {
                var(apiVersion, legacyApiVersion, legacyApiMinVersion, qVersion) = await TaskHelper.WhenAll(
                    client.GetApiVersionAsync(),
                    client.GetLegacyApiVersionAsync(),
                    client.GetLegacyMinApiVersionAsync(),
                    client.GetQBittorrentVersionAsync());

                var doc = new Document(
                    new Grid
                {
                    Stroke   = UIHelper.NoneStroke,
                    Columns  = { UIHelper.FieldsColumns },
                    Children =
                    {
                        UIHelper.Row("QBittorrent version",    qVersion),
                        UIHelper.Row("API version",            apiVersion),
                        UIHelper.Row("Legacy API version",     legacyApiVersion),
                        UIHelper.Row("Legacy API min version", legacyApiMinVersion)
                    }
                }
                    ).SetColors(ColorScheme.Current.Normal);

                ConsoleRenderer.RenderDocument(doc);

                return(ExitCodes.Success);
            }