예제 #1
0
        private async void UploadMainVideoBtn_Click(object sender, EventArgs e)
        {
            _logger.LogTrace($"{GetType()} - BEGIN {nameof(UploadMainVideoBtn_Click)}");
            if (!CheckSelectedRow())
            {
                return;
            }

            Progress <UploadStatusModel> progress = new Progress <UploadStatusModel>(status => {
                UploadProgressBar.Value = (int)status.CompletionRate;
                ProgressLabel.Text      = $"{status.CompletionRate}% ({status.StatusText})";
            });

            DataGridViewRow  row = VideoDGV.SelectedRows[0];
            PublicationModel publicationModel = row.DataBoundItem as PublicationModel;

            DialogResult result = VideoFileDialog.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                VideoModel videoModel = new VideoModel()
                {
                    Metadata    = publicationModel.MainVideo,
                    VideoStream = VideoFileDialog.OpenFile()
                };

                await Task.Run(() => { _videoService.UploadVideoAsync(videoModel, progress, CancellationToken.None); });
            }
            else
            {
                MessageBox.Show("OK on fera ça plus tard 😉");
            }
        }
예제 #2
0
 /// <summary>
 /// Gets the path of the video.
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event Args</param>
 private void Button_VideoPath_Click(object sender, EventArgs e)
 {
     VideoFileDialog.ShowDialog();
     TextBox_VideoPath.Text = VideoFileDialog.FileName;
 }