Exemplo n.º 1
0
        private async Task GetStatusAsync(FcvsClient client, string fid, CancellationToken cancellationToken = default(CancellationToken))
        {
            //Call API
            Terminal.WriteDebug($"Getting Status of Current Profile for FID {fid}");
            try
            {
                var status = await client.GetStatusAsync("me", fid, cancellationToken).ConfigureAwait(false);

                if (status != null)
                {
                    Terminal.WriteLine(JsonConvert.SerializeObject(status, Formatting.Indented));
                }
            }
            catch (Exception e)
            {
                e = e.Unwrap();
                Terminal.WriteError(e.Message);
            }
        }
Exemplo n.º 2
0
        private async Task OnProfileAsync(FcvsClient client)
        {
            try
            {
                //Get the FID
                Terminal.WriteLine("Get profile");
                var fid = Terminal.ReadString("FID? (or ENTER to cancel) ", allowEmptyStrings: true);
                if (String.IsNullOrEmpty(fid))
                {
                    return;
                }

                await GetCurrentProfileAsync(client, fid).ConfigureAwait(false);
            }
            catch (Exception e)
            {
                e = e.Unwrap();

                Terminal.WriteError(e.Message);
            };
        }
Exemplo n.º 3
0
        private Task OnQuitAsync(FcvsClient client)
        {
            _quit = true;

            return(Task.CompletedTask);
        }