public void InitCards(List <VideoClass.episode> avs) { int lastx = 0, lasty = 0, i = 0; //DisableAllCards(); avList = avs; foreach (VideoClass.episode av in avs) { AVCard card = new AVCard(av); card.Size = new Size(card.Size.Width + 10, card.Size.Width + 10); i++; if (i == 5) { lasty = lasty + card.Size.Height; lastx = 0; i = 1; card.Location = new Point(lastx + 10, lasty); lastx += card.Size.Width; panel2.Controls.Add(card); } else { card.Location = new Point(lastx + 10, lasty); lastx += card.Size.Width; panel2.Controls.Add(card); } } }
private void QualityBox_SelectedIndexChanged(object sender, EventArgs e) { foreach (Control c in videoList1.panel2.Controls) { if (c is UI.AVCard) { UI.AVCard card = (UI.AVCard)c; card.QualityBox.SelectedIndex = QualityBox.SelectedIndex; } } }
private void SelectAll_Click(object sender, EventArgs e) { foreach (Control c in videoList1.panel2.Controls) { if (c is UI.AVCard) { UI.AVCard card = (UI.AVCard)c; card.check = true; } } }
private void materialFlatButton2_Click(object sender, EventArgs e) { foreach (Control c in videoList1.panel2.Controls) { if (c is UI.AVCard) { UI.AVCard card = (UI.AVCard)c; card.check = !card.check; } } }
private void DownloadSelected_Click(object sender, EventArgs e) { foreach (Control c in videoList1.panel2.Controls) { if (c is UI.AVCard) { UI.AVCard card = (UI.AVCard)c; if (card.check) { card.StartDownload(); } } } }
public void InitCards(List <VideoClass.episode> avs) { int lastx = 0, lasty = 0, i = 0; //DisableAllCards(); avList = avs; foreach (VideoClass.episode av in avs) { AVCard card = new AVCard(av); card.Size = new Size(card.Size.Width + 10, card.Size.Height + 10); i++; if (Environment.OSVersion.Platform != PlatformID.Unix) { card.Location = new Point(lastx + 10, lasty); } else { card.Location = new Point(lastx, lasty); } if (Environment.OSVersion.Platform != PlatformID.Unix) { lastx += card.Size.Width; } else { lastx += 270; } panel2.Controls.Add(card); if (i == 4) { if (Environment.OSVersion.Platform != PlatformID.Unix) { lasty = lasty + card.Size.Height + 70; } else { lasty = lasty + card.Size.Height; } lastx = 0; i = 0; } } LoadCardsImages(); }
private void materialSingleLineTextField1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { foreach (Control c in videoList1.panel2.Controls) { if (c is UI.AVCard) { UI.AVCard card = (UI.AVCard)c; card.DPath = materialSingleLineTextField1.Text; } } MessageBox.Show(materialSingleLineTextField1.Text); } }
private async System.Threading.Tasks.Task <int> LoadCardsImages(int start) { for (int offset = 0; start + offset < panel2.Controls.Count && offset < 8; offset++) { if (start + offset < 0) { continue; } AVCard card = (AVCard)panel2.Controls[offset + start]; if (!card.imageloaded) { card.LoadImage(); } } return(0); }
private async void LoadCardsImages(int start) { await Task.Run(() => { for (int offset = 0; start + offset < panel2.Controls.Count && offset < 8; offset++) { if (start + offset < 0) { continue; } AVCard card = (AVCard)panel2.Controls[offset + start]; if (!card.imageloaded) { card.LoadImage(); } } }); }
private void materialFlatButton3_Click(object sender, EventArgs e) { FolderBrowserDialog dialog = new FolderBrowserDialog(); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { foreach (Control c in videoList1.panel2.Controls) { if (c is UI.AVCard) { UI.AVCard card = (UI.AVCard)c; card.DPath = dialog.SelectedPath; } } materialSingleLineTextField1.Text = dialog.SelectedPath; } }
private void DownloadSelected_Click(object sender, EventArgs e) { foreach (Control c in videoList1.panel2.Controls) { if (c is UI.AVCard) { UI.AVCard card = (UI.AVCard)c; if (string.IsNullOrEmpty(card.DPath)) { MessageBox.Show("请选择下载路径!"); return; } if (card.check) { card.StartDownload(); } } } }