Пример #1
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            log.Text = "Analyzing...";

            string opurl = await SubmitVideo(url.Text);

            while (true)
            {
                dynamic r = await Cli.GetDynamic(opurl);

                log.Text = r.status;
                if (r.status == "Succeeded")
                {
                    result = r.processingResult;
                    break;
                }
                if (r.status == "Running")
                {
                    var f = float.Parse(r.progress.ToString());
                    pro.Value = f;
                }
                if (r.status == "Failed")
                {
                    break;
                }
                await Task.Delay(30000);
            }
            if (result == null)
            {
                return;
            }
            Draw(result, 0);
        }