private async void AddFolderBtn_Click(object sender, EventArgs e) { FolderBrowserDialog fo = new FolderBrowserDialog(); if (fo.ShowDialog() == DialogResult.OK) { var files = Directory.GetFiles(fo.SelectedPath); foreach (var item in files) { if (Path.GetExtension(item) == ".mp4" || Path.GetExtension(item) == ".flv" || Path.GetExtension(item) == ".mkv") { var vi = await view.Frm.data.Videos.AddVideo(item); progressBar1.Invoke((MethodInvoker) delegate { progressBar1.Value++; }); Tumb t = new Tumb { vid = vi }; t.pictureBox1.Image = vi.Tumbnail; t.lblname.Text = vi.Name; Wall.Controls.Add(t); } } } progressBar1.Value = 0; }
private async void AddBtn_Click(object sender, EventArgs e) { OpenFileDialog a = new OpenFileDialog { Multiselect = true, Filter = "Audio & Video Files|*.mp4;*.flv;*.mkv;*.mp3" }; if (a.ShowDialog() == DialogResult.OK) { progressBar1.Maximum = a.FileNames.Length; foreach (var item in a.FileNames) { progressBar1.Invoke((MethodInvoker) delegate { progressBar1.Value++; }); var vi = await view.Frm.data.Videos.AddVideo(item); Tumb t = new Tumb { vid = vi }; t.pictureBox1.Image = vi.Tumbnail; t.lblname.Text = vi.Name; Wall.Controls.Add(t); } } progressBar1.Value = 0; }
private void RefreshBtn_Click(object sender, EventArgs e) { Wall.Controls.Clear(); foreach (var vi in view.Frm.data.Videos.Items) { Tumb t = new Tumb { vid = vi }; t.pictureBox1.Image = vi.Tumbnail; t.lblname.Text = vi.Name; Wall.Controls.Add(t); } }