コード例 #1
0
ファイル: fmMain.cs プロジェクト: ramonliu/drama-tracer
 private void lstvDrama_SelectedIndexChanged(object sender, EventArgs e)
 {
     curDrama = null;
     var items = lstvDrama.SelectedItems;
     if (items.Count != 1)
         return;            
     txtURL.Text = items[0].ToolTipText;
     curDrama = db.DramaGet(items[0].Text);
     txtID.Text = curDrama.UserNmae;
     txtPWD.Text = curDrama.Password;
     tvLinks.Nodes.Clear();
     tvLinks.CheckBoxes = false;
     var episodes = db.EpisodeLoad((int)items[0].Tag);
     foreach(DBEpisode epi in episodes)
     {
         AddToTreeView(epi, true);
     }
     Application.DoEvents();
     tvLinks.Nodes[tvLinks.Nodes.Count - 1].ExpandAll();
     tvLinks.SelectionMode = TreeViewSelectionMode.MultiSelectSameLevel;
 }
コード例 #2
0
ファイル: fmMain.cs プロジェクト: ramonliu/drama-tracer
 private void CheckDrama(ListViewItem item)
 {
     curDrama = db.DramaGet(item.Text);
     var bkDrama = curDrama;
     txtURL.Text = curDrama.URL;
     txtID.Text = curDrama.UserNmae;
     txtPWD.Text = curDrama.Password;
     btnCheck.PerformClick();
     WaitQueryDone();
     curDrama = bkDrama;
     List<TreeNode> uncheck_nodes = new List<TreeNode>();
     FilterEpisode(ref uncheck_nodes);
     RemoveUnuseLinks();
     AddUnSelectLinksAndDownload(uncheck_nodes);
     item.StateImageIndex = (int)ImgIdx.CheckOk;
 }
コード例 #3
0
ファイル: fmMain.cs プロジェクト: ramonliu/drama-tracer
        private void btnCheck_Click(object sender, EventArgs e)
        {
            if (txtURL.Text.Length <= 0)
                return;

            this.Cursor = Cursors.WaitCursor;

            curDrama = null;

            if (Https == null)
            {
                Https = new lstHttp();
            }
            
            var http = Https.Get(txtURL.Text);
            http.UserName = txtID.Text;
            http.Password = txtPWD.Text;
            http.Parser(txtURL.Text);
            tvLinks.Tag = http.Title;
            this.Text = (string)tvLinks.Tag;
            if ((null != http.Links) && (http.Links.Count > 0))
            {
                tvLinks.Nodes.Clear();
                tvLinks.CheckBoxes = true;
                foreach (DBEpisode epi in http.Links)
                {
                    AddToTreeView(epi, false);                                        
                }                
            }
            tvLinks.SelectionMode = TreeViewSelectionMode.SingleSelect;
            Application.DoEvents();
            this.Cursor = Cursors.Default;
        }