Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Laval <jeremie.laval@gmail.com>2012-03-30 02:42:13 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2012-03-30 02:42:13 +0400
commit6ae14ce73450e92b762c0a2231915c3699d91426 (patch)
tree8e4ce8f70ac8e8a525e7e8577ec4814eb216103e
parent9a2760e25e47e363199c566c0e5780405df942a1 (diff)
[appledocwizard] Update progress value
-rw-r--r--AppleDocWizard/AppleDocHandler.cs7
-rw-r--r--AppleDocWizard/AppleDocWizard.cs4
2 files changed, 8 insertions, 3 deletions
diff --git a/AppleDocWizard/AppleDocHandler.cs b/AppleDocWizard/AppleDocHandler.cs
index 4301f71..628ebde 100644
--- a/AppleDocWizard/AppleDocHandler.cs
+++ b/AppleDocWizard/AppleDocHandler.cs
@@ -161,7 +161,12 @@ namespace macdoc
WebClient client = new WebClient ();
client.DownloadFileCompleted += (sender, e) => HandleAppleDocDownloadFinished (e, infos, tempPath, evt, token);
- client.DownloadProgressChanged += (sender, e) => { evtArgs.Percentage = e.ProgressPercentage; FireAppleDocEvent (evtArgs); };
+ client.DownloadProgressChanged += (sender, e) => {
+ if (e.ProgressPercentage - evtArgs.Percentage < 1.0)
+ return;
+ evtArgs.Percentage = e.ProgressPercentage;
+ FireAppleDocEvent (evtArgs);
+ };
FireAppleDocEvent (new AppleDocEventArgs () { Stage = ProcessStage.Downloading, Percentage = -1 });
client.DownloadFileAsync (new Uri (infos.DownloadUrl), tempPath);
diff --git a/AppleDocWizard/AppleDocWizard.cs b/AppleDocWizard/AppleDocWizard.cs
index a67ba05..ca0605e 100644
--- a/AppleDocWizard/AppleDocWizard.cs
+++ b/AppleDocWizard/AppleDocWizard.cs
@@ -43,7 +43,7 @@ namespace macdoc
case ProcessStage.Downloading:
if (currentStage == ProcessStage.Downloading) {
progressIndicator.DoubleValue = e.Percentage;
- extraStageInfoLabel.IntValue = e.Percentage;
+ extraStageInfoLabel.StringValue = e.Percentage + " %";
} else {
currentStage = ProcessStage.Downloading;
progressIndicator.Indeterminate = false;
@@ -54,7 +54,7 @@ namespace macdoc
break;
case ProcessStage.Extracting:
if (currentStage == ProcessStage.Extracting)
- extraStageInfoLabel.StringValue = e.CurrentFile;
+ extraStageInfoLabel.StringValue = e.CurrentFile ?? "(none)";
else {
currentStage = ProcessStage.Extracting;
progressIndicator.Indeterminate = true;