Example #1
0
        private bool CheckAllDownloadComplete()
        {
            bool state = true;

            Control.ControlCollection ctrlColl = this.flpDownloadList.Controls;

            foreach (Control ctrl in ctrlColl)
            {
                if (ctrl.GetType().Equals(typeof(ucDownloadInfoBox)))
                {
                    ucDownloadInfoBox downInfoBox = ctrl as ucDownloadInfoBox;

                    if (downInfoBox.GetCheckState())
                    {
                        if (downInfoBox.DownloadComlete)
                        {
                            state &= true;
                        }
                        else
                        {
                            state = false;
                        }
                    }
                    else
                    {
                        state &= true;
                    }
                }
            }

            return(state);
        }
Example #2
0
        private void DownloadComplete()
        {
            this.Cursor = Cursors.Default;
            this.mDownCheckTimer.Stop();
            this.SetControlEnabled(false);

            List <ucDownloadInfoBox> completeList = new List <ucDownloadInfoBox>();

            Control.ControlCollection ctrlColl = this.flpDownloadList.Controls;

            foreach (Control ctrl in ctrlColl)
            {
                if (ctrl.GetType().Equals(typeof(ucDownloadInfoBox)))
                {
                    ucDownloadInfoBox downInfoBox = ctrl as ucDownloadInfoBox;

                    if (downInfoBox.DownloadComlete)
                    {
                        completeList.Add(downInfoBox);
                    }
                }
            }

            foreach (ucDownloadInfoBox downInfoBox in completeList)
            {
                this.flpDownloadList.Controls.Remove(downInfoBox);
            }
        }
Example #3
0
        private void UpdateDownloadList(YoutubeModel aModel, string aLink)
        {
            ucDownloadInfoBox downInfoBox = new ucDownloadInfoBox();

            downInfoBox.Width = this.flpDownloadList.Width - 20;
            downInfoBox.SetDownloadInfo(aModel, aLink);
            this.flpDownloadList.Controls.Add(downInfoBox);

            //Reset the textbox where the link was typed in
            this.tbxYoutubeUrl.Text = string.Empty;
        }
Example #4
0
        private void cbxCheckAllDownloadList_CheckedChanged(object sender, EventArgs e)
        {
            Control.ControlCollection ctrlColl = this.flpDownloadList.Controls;

            foreach (Control ctrl in ctrlColl)
            {
                if (ctrl.GetType().Equals(typeof(ucDownloadInfoBox)))
                {
                    ucDownloadInfoBox downInfoBox = ctrl as ucDownloadInfoBox;

                    if (this.cbxCheckAllDownloadList.Checked)
                    {
                        downInfoBox.SetCheck();
                    }
                    else
                    {
                        downInfoBox.SetUnCheck();
                    }
                }
            }
        }
Example #5
0
        private void Download()
        {
            this.Cursor = Cursors.WaitCursor;
            this.mDownCheckTimer.Start();
            this.SetControlEnabled(true);

            Control.ControlCollection ctrlColl = this.flpDownloadList.Controls;

            foreach (Control ctrl in ctrlColl)
            {
                if (ctrl.GetType().Equals(typeof(ucDownloadInfoBox)))
                {
                    ucDownloadInfoBox downInfoBox = ctrl as ucDownloadInfoBox;

                    if (downInfoBox.GetCheckState())
                    {
                        downInfoBox.Download();
                    }
                }
            }
        }
Example #6
0
        private int GetCheckDownloadListCount()
        {
            int checkCnt = 0;

            Control.ControlCollection ctrlColl = this.flpDownloadList.Controls;

            foreach (Control ctrl in ctrlColl)
            {
                if (ctrl.GetType().Equals(typeof(ucDownloadInfoBox)))
                {
                    ucDownloadInfoBox downInfoBox = ctrl as ucDownloadInfoBox;

                    if (downInfoBox.GetCheckState())
                    {
                        checkCnt++;
                    }
                }
            }

            return(checkCnt);
        }
Example #7
0
        private void DeleteCheckDownloadList()
        {
            List <ucDownloadInfoBox> delList = new List <ucDownloadInfoBox>();

            Control.ControlCollection ctrlColl = this.flpDownloadList.Controls;

            foreach (Control ctrl in ctrlColl)
            {
                if (ctrl.GetType().Equals(typeof(ucDownloadInfoBox)))
                {
                    ucDownloadInfoBox downInfoBox = ctrl as ucDownloadInfoBox;

                    if (downInfoBox.GetCheckState())
                    {
                        delList.Add(downInfoBox);
                    }
                }
            }

            foreach (ucDownloadInfoBox downInfoBox in delList)
            {
                this.flpDownloadList.Controls.Remove(downInfoBox);
            }
        }
Example #8
0
        private bool CheckExistDownloadList()
        {
            int count    = 0;
            int checkCnt = 0;

            Control.ControlCollection ctrlColl = this.flpDownloadList.Controls;

            foreach (Control ctrl in ctrlColl)
            {
                if (ctrl.GetType().Equals(typeof(ucDownloadInfoBox)))
                {
                    count++;

                    ucDownloadInfoBox downInfoBox = ctrl as ucDownloadInfoBox;

                    if (downInfoBox.GetCheckState())
                    {
                        checkCnt++;
                    }
                }
            }

            if (count < 1)
            {
                MessageBox.Show(this, "리스트에 추가된 동영상이 존재하지 않습니다.", ConstValue.MSGBOX_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }

            if (checkCnt < 1)
            {
                MessageBox.Show(this, "리스트에 체크된 동영상이 존재하지 않습니다.", ConstValue.MSGBOX_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }

            return(true);
        }