• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamephpguicwindows翻訳pythonomegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

将棋ウォーズ棋譜を検索条件を指定して一括でダウンロードする。


コミットメタ情報

リビジョン5 (tree)
日時2015-01-27 11:41:08
作者bellyoshi

ログメッセージ

プログレスバーを動かす。

変更サマリ

差分

--- ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/frmProgress.Designer.vb (revision 4)
+++ ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/frmProgress.Designer.vb (revision 5)
@@ -65,7 +65,7 @@
6565 Me.Controls.Add(Me.pbProgress)
6666 Me.Controls.Add(Me.btnCancel)
6767 Me.Name = "frmProgress"
68- Me.Text = "棋譜ダウンロード中(XXX/XXX)"
68+ Me.Text = "棋譜ダウンロード中"
6969 Me.ResumeLayout(False)
7070
7171 End Sub
--- ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/frmProgress.vb (revision 4)
+++ ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/frmProgress.vb (revision 5)
@@ -12,7 +12,13 @@
1212
1313 Private Sub BackgroundWorker1_ProgressChanged(sender As System.Object, e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
1414 lblKifuFileName.Text = e.UserState
15-
15+ If downloder.IsDownloading Then
16+ Me.Text = String.Format("棋譜ダウンロード中({0}/{1})",
17+ downloder.DownLoadIndex,
18+ downloder.DownLoadsListsCount)
19+ pbProgress.Maximum = downloder.DownLoadsListsCount
20+ pbProgress.Value = downloder.DownLoadIndex
21+ End If
1622 End Sub
1723
1824 End Class
\ No newline at end of file
--- ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/downloder.vb (revision 4)
+++ ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/downloder.vb (revision 5)
@@ -10,8 +10,10 @@
1010 Public Property name1 As String
1111 Public Property name2 As String
1212 Public Property gType As Integer
13+ Public Property DownLoadsListsCount As Integer
14+ Public Property DownLoadIndex As Integer
15+ Public Property IsDownloading As Boolean = False
1316
14-
1517 Private Sub New()
1618 End Sub
1719 Public Sub New(ByVal bg As System.ComponentModel.BackgroundWorker,
@@ -30,7 +32,7 @@
3032 ListPageReadReq()
3133 _backGroudWoker.ReportProgress(0, "ダウンロード開始")
3234 DownLoadsReq()
33- _backGroudWoker.ReportProgress(0, "ダウンロード終了")
35+ _backGroudWoker.ReportProgress(100, "ダウンロード終了")
3436 End Sub
3537 Private Sub LoginReq()
3638
@@ -61,13 +63,16 @@
6163
6264 Dim dirfullpath As String = _saveDirectory
6365 If Not IOUtil.CreateDirectoryIfNotExist(dirfullpath) Then
64- _backGroudWoker.ReportProgress(100, String.Format("ディレクトリ""{0}""が作成できません", dirfullpath))
66+ _backGroudWoker.ReportProgress(0, String.Format("ディレクトリ""{0}""が作成できません", dirfullpath))
6567 Exit Sub
6668 End If
6769
70+ DownLoadIndex = 0
71+ IsDownloading = True
6872 For Each link As aLink In downloadLists
69- _backGroudWoker.ReportProgress(100, String.Format("{0}", link.Text))
73+ _backGroudWoker.ReportProgress(DownLoadIndex / DownLoadsListsCount, String.Format("{0}", link.Text))
7074 DownLoadOneLink(wc, link, dirfullpath)
75+ DownLoadIndex += 1
7176 Next
7277
7378 wc.Dispose()
@@ -110,9 +115,8 @@
110115 Dim resText As String = HttpPostUtl.HttpPost(baseUrl, ps, cc, encoder)
111116
112117 downloadLists = GetLinks(resText)
118+ DownLoadsListsCount = downloadLists.Count
113119
114-
115-
116120 End Sub
117121
118122 Private Function GetLinks(ByVal text As String) As IList(Of aLink)