Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
 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;
         }
     }
 }
Exemplo n.º 3
0
 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;
         }
     }
 }
Exemplo n.º 4
0
        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;
                }
            }
        }
Exemplo n.º 5
0
 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();
             }
         }
     }
 }
Exemplo n.º 6
0
        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();
        }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
 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);
 }
Exemplo n.º 9
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();
                    }
                }
            });
        }
Exemplo n.º 10
0
        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;
            }
        }
Exemplo n.º 11
0
 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();
             }
         }
     }
 }