Beispiel #1
0
        public MainForm()
        {
            EXEPath = System.Environment.CurrentDirectory;
            if (!Directory.Exists(EXEPath + "/torrent")) {
                Directory.CreateDirectory(EXEPath + "/torrent");
            }
            InitializeComponent();
            //所有星期初始化
            allWeek = new List<String>();
            allWeek.AddRange(new String[] { "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日" });
            //今天的星期
            DayOfWeek dw = DateTime.Now.DayOfWeek;
            String w = dw.ToString().Substring(0, 3).ToLower();
            currentWeek = TextUtils.engToWeek(w);
            menuStripWeek.Items[allWeek.IndexOf(currentWeek)].ForeColor = Color.OrangeRed;
            //增加ListView行距
            ImageList imageList1 = new ImageList();
            imageList1.ImageSize = new Size(1, 25);
            listView1.SmallImageList = imageList1;
            //来源初始化
            currentRK = ResourcesKind.DMHY;
            source = Factory.create(currentRK);
            toolStripComboBoxSources.SelectedIndex = (int)currentRK;

            //初始化
            //窗口非使能
            EnabledUI(false);
            Thread t = new Thread(initIndex);
            t.IsBackground = true;
            t.Start();
        }
Beispiel #2
0
        public MainForm()
        {
            EXEPath = System.Environment.CurrentDirectory;
            if (!Directory.Exists(EXEPath + "/torrent"))
            {
                Directory.CreateDirectory(EXEPath + "/torrent");
            }
            InitializeComponent();
            //所有星期初始化
            allWeek = new List <String>();
            allWeek.AddRange(new String[] { "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日" });
            //今天的星期
            DayOfWeek dw = DateTime.Now.DayOfWeek;
            String    w  = dw.ToString().Substring(0, 3).ToLower();

            currentWeek = TextUtils.engToWeek(w);
            menuStripWeek.Items[allWeek.IndexOf(currentWeek)].ForeColor = Color.OrangeRed;
            //增加ListView行距
            ImageList imageList1 = new ImageList();

            imageList1.ImageSize     = new Size(1, 25);
            listView1.SmallImageList = imageList1;
            //来源初始化
            currentRK = ResourcesKind.DMHY;
            source    = Factory.create(currentRK);
            toolStripComboBoxSources.SelectedIndex = (int)currentRK;

            //初始化
            //窗口非使能
            EnabledUI(false);
            Thread t = new Thread(initIndex);

            t.IsBackground = true;
            t.Start();
        }
Beispiel #3
0
 internal static IASource create(ResourcesKind currentRK)
 {
     if (currentRK == ResourcesKind.DMHY) {
         return new DMHY();
     }
     return new KTXP();
 }
Beispiel #4
0
 internal static IASource create(ResourcesKind currentRK)
 {
     if (currentRK == ResourcesKind.DMHY)
     {
         return(new DMHY());
     }
     return(new KTXP());
 }
Beispiel #5
0
        /************************************************************************/
        /* 选择来源                                                             */
        /************************************************************************/
        private void toolStripComboBoxSources_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = ((ToolStripComboBox)sender).SelectedIndex;

            if ((int)currentRK == index)
            {
                return;
            }
            currentRK = (ResourcesKind)index;
            source    = Factory.create(currentRK);
            EnabledUI(false);
            Thread t = new Thread(initIndex);

            t.IsBackground = true;
            t.Start();
        }
Beispiel #6
0
 /************************************************************************/
 /* 选择来源                                                             */
 /************************************************************************/
 private void toolStripComboBoxSources_SelectedIndexChanged(object sender, EventArgs e)
 {
     int index = ((ToolStripComboBox)sender).SelectedIndex;
     if ((int)currentRK == index) {
         return;
     }
     currentRK = (ResourcesKind)index;
     source = Factory.create(currentRK);
     EnabledUI(false);
     Thread t = new Thread(initIndex);
     t.IsBackground = true;
     t.Start();
 }