Ejemplo n.º 1
0
 /// <summary>
 /// 初始化线程
 /// </summary>
 /// <param name="threadPoolCount">线程池数量</param>
 public S_CollectThread(M_Category category,String folderPath)
 {
     this.Category = category;
     this.FolderPath = folderPath;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取类别(根据当前的选项卡,获取类别)
        /// </summary>
        /// <returns></returns>
        private List<M_Category> GetCategory(int selectedIndex, bool isAll = false)
        {
            List<M_Category> list = new List<M_Category>();

            //选中第几期
            Control ctl = flp1;
            switch (selectedIndex)
            {
                case 0: ctl = flp1; break;
                case 1: ctl = flp2; break;
                case 2: ctl = flp3; break;
            }

            //获取所有选中的类别
            foreach (Control ct in ctl.Controls)
            {
                if (ct.GetType().ToString().Equals("System.Windows.Forms.CheckBox"))
                {
                    CheckBox cb = (CheckBox)ct;
                    if (isAll)
                    {
                        M_Category category = new M_Category();
                        category.Title = cb.Text;
                        category.Param = cb.Tag.ToString();
                        category.TimePhase = selectedIndex + 1;
                        list.Add(category);
                    }
                    else
                    {
                        if (cb.Checked)
                        {
                            M_Category category = new M_Category();
                            category.Title = cb.Text;
                            category.Param = cb.Tag.ToString();
                            category.TimePhase = selectedIndex + 1;
                            list.Add(category);
                        }
                    }

                }
            }
            return list;
        }