コード例 #1
0
 public LiplisNicoDownLoader(ObjDownloadFile item, DataGridViewRow dgv, string nicoId, string nicoPass)
 {
     this.item     = item;
     this.dgv      = dgv;
     this.nicoId   = nicoId;
     this.nicoPass = nicoPass;
 }
コード例 #2
0
        public DataGridViewRow addDownload(ObjDownloadFile item)
        {
            try
            {
                DataGridViewProgressBarCell ccdgcpb = new DataGridViewProgressBarCell();
                ccdgcpb.Maximum = 100;
                ccdgcpb.Mimimum = 0;
                ccdgcpb.Value = 0;

                dgvDownloader.Rows.Add(new object[] { FctCreateFromResource.getIconExtention(convertIcoCd(item.kbn)), item.title, item.fileSize, ccdgcpb });
                return dgvDownloader.Rows[dgvDownloader.Rows.Count - 1];
            }
            catch
            {
                return null;
            }
        }
コード例 #3
0
        public void doInitThreadMp3(ObjDownloadFile item, DataGridViewRow dgv)
        {
            LiplisNicoDownLoader lndl = new LiplisNicoDownLoader(item, dgv, os.nicoId, os.nicoPass);

            //画像作成するスレッドを生成
            imgThread = new Thread(new ThreadStart(lndl.mp3Download));

            //WebBrowserはシングルスレッドアパートメントモードでのみ実行可能なのでスレッドのモードを設定して実行する
            imgThread.SetApartmentState(ApartmentState.STA);

            //スレッドスタート
            imgThread.Start();

            //スレッド終了を待つ
            //imgThread.Join();

            //スレッドを終了
            //imgThread.Abort();

            return;
        }
コード例 #4
0
 private void doDownload(ObjDownloadFile item, DataGridViewRow dgv)
 {
     //フラグがオフならダウンロードする
     if (!item.flgEnd)
     {
         switch (item.kbn)
         {
             case 0:
                 downloadHmt(item, dgv);
                 return;
             case 10:
                 downloadDoga(item, dgv);
                 return;
             case 11:
                 downloadMp3(item, dgv);
                 return;
             default:
                 downloadHmt(item, dgv);
                 return;
         }
     }
     //フラグがオンなら履歴に追加する
     else
     {
         return;
     }
 }
コード例 #5
0
 private void downloadMp3(ObjDownloadFile item, DataGridViewRow dgv)
 {
     try
     {
         doInitThreadMp3(item, dgv);
     }
     catch (Exception err)
     {
         Console.Write(err);
         return;
     }
 }
コード例 #6
0
        private void downloadHmt(ObjDownloadFile item, DataGridViewRow dgv)
        {
            try
            {
                //ダウンロード
                new MhtDownloader(item.url).Write(LpsPathController.getSaveFileName(LpsDefineMost.LPS_EXTENSION_MHT, os.downPath, item.title, os.downNotice));

                item.flgEnd = true;
            }
            catch (Exception err)
            {
                Console.Write(err);
            }
        }