OSDN Git Service

na-get-lib,ダウンロードサイズ不明時に進捗%が出ないように修正。動作も確認
authorttp <ttp@users.sourceforge.jp>
Sat, 25 Oct 2008 14:22:02 +0000 (14:22 +0000)
committerttp <ttp@users.sourceforge.jp>
Sat, 25 Oct 2008 14:22:02 +0000 (14:22 +0000)
git-svn-id: http://localhost/svn/AppliStation/trunk@988 34ed2c89-c49f-4a4b-abdb-c318350108cf

na-get-lib/NaGet.Net/Downloader.cs

index 165d6b2..9fab357 100644 (file)
@@ -277,10 +277,10 @@ public class Downloader : NaGetTask
                                        \r
                                        if (stopwatch != null && stopwatch.IsRunning && stopwatch.ElapsedMilliseconds > 3000) {\r
                                                long bpers = e.DownloadSize * 1000 / stopwatch.ElapsedMilliseconds;\r
                                        \r
                                        if (stopwatch != null && stopwatch.IsRunning && stopwatch.ElapsedMilliseconds > 3000) {\r
                                                long bpers = e.DownloadSize * 1000 / stopwatch.ElapsedMilliseconds;\r
-                                               try {\r
+                                               if (e.TaskProgressPercent >= 0) {\r
                                                        TimeSpan rest = TimeSpan.FromSeconds((max - e.DownloadSize) / bpers);\r
                                                        e.TaskMessage += string.Format(" 推定残り時間:{0} ({1}/s)", rest, NaGet.Utils.FormatSize(bpers));\r
                                                        TimeSpan rest = TimeSpan.FromSeconds((max - e.DownloadSize) / bpers);\r
                                                        e.TaskMessage += string.Format(" 推定残り時間:{0} ({1}/s)", rest, NaGet.Utils.FormatSize(bpers));\r
-                                               } catch {\r
+                                               } else {\r
                                                        e.TaskMessage += string.Format(" ({0}/s)", NaGet.Utils.FormatSize(bpers));\r
                                                }\r
                                        }\r
                                                        e.TaskMessage += string.Format(" ({0}/s)", NaGet.Utils.FormatSize(bpers));\r
                                                }\r
                                        }\r