Version reverted to last version

This commit is contained in:
robvde 2012-07-04 19:17:09 +04:00
parent 2a44c64e40
commit ef73b0d1c6

View file

@ -1,4 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation. // Copyright (c) 2012, Outercurve Foundation.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
@ -80,7 +80,7 @@ namespace WebsitePanel.Installer.Core
private WebClient fileLoader; private WebClient fileLoader;
internal BitlyLoader(string remoteFile) public BitlyLoader(string remoteFile)
: base(remoteFile) : base(remoteFile)
{ {
InitFileLoader(); InitFileLoader();
@ -115,7 +115,7 @@ namespace WebsitePanel.Installer.Core
Log.WriteStart("Downloading file"); Log.WriteStart("Downloading file");
Log.WriteInfo("Downloading file \"{0}\" to \"{1}\"", remoteFile, tmpFile); Log.WriteInfo("Downloading file \"{0}\" to \"{1}\"", remoteFile, tmpFile);
// Attach event handlers to track status of the download process // Attach event handlers to track status of the download process
fileLoader.DownloadProgressChanged += (obj, e) => fileLoader.DownloadProgressChanged += (obj, e) =>
{ {
@ -145,7 +145,7 @@ namespace WebsitePanel.Installer.Core
fileLoader.DownloadFileAsync(new Uri(remoteFile), tmpFile); fileLoader.DownloadFileAsync(new Uri(remoteFile), tmpFile);
RaiseOnStatusChangedEvent(DownloadingSetupFilesMessage); RaiseOnStatusChangedEvent(DownloadingSetupFilesMessage);
autoEvent.WaitOne(); autoEvent.WaitOne();
} }
}, ct); }, ct);
@ -175,7 +175,7 @@ namespace WebsitePanel.Installer.Core
public event EventHandler<LoaderEventArgs<Int32>> ProgressChanged; public event EventHandler<LoaderEventArgs<Int32>> ProgressChanged;
public event EventHandler<EventArgs> OperationCompleted; public event EventHandler<EventArgs> OperationCompleted;
internal Loader(string remoteFile) public Loader(string remoteFile)
{ {
this.remoteFile = remoteFile; this.remoteFile = remoteFile;
} }
@ -276,7 +276,7 @@ namespace WebsitePanel.Installer.Core
// Download the file requested // Download the file requested
Task downloadFileTask = GetDownloadFileTask(remoteFile, tmpFile, token); Task downloadFileTask = GetDownloadFileTask(remoteFile, tmpFile, token);
// Move the file downloaded from temporary location to Data folder // Move the file downloaded from temporary location to Data folder
var moveFileTask = downloadFileTask.ContinueWith((t) => var moveFileTask = downloadFileTask.ContinueWith((t) =>
{ {
if (File.Exists(tmpFile)) if (File.Exists(tmpFile))
{ {
@ -312,7 +312,7 @@ namespace WebsitePanel.Installer.Core
{ {
RaiseOnOperationCompletedEvent(); RaiseOnOperationCompletedEvent();
}, token); }, token);
downloadFileTask.Start(); downloadFileTask.Start();
downloadFileTask.Wait(); downloadFileTask.Wait();
} }
@ -527,4 +527,4 @@ namespace WebsitePanel.Installer.Core
} }
} }
} }
} }