示例#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();
        }
示例#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();
        }
示例#3
0
 public DetailWeb(String url, String title, IASource source)
 {
     InitializeComponent();
     webBrowser1.DocumentText = @"<h1>正在加载。。。</h1>";
     this.Text   = title;
     this.source = source;
     updateHtml(url);
 }
示例#4
0
 public DetailWeb(String url, String title, IASource source)
 {
     InitializeComponent();
     webBrowser1.DocumentText = @"<h1>正在加载。。。</h1>";
     this.Text = title;
     this.source = source;
     updateHtml(url);
 }
示例#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();
        }
示例#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();
 }