diff options
author | sr55 <[email protected]> | 2009-01-29 21:49:05 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-01-29 21:49:05 +0000 |
commit | 0333e36d98952fc75b07a35bb2dd5affe526b25a (patch) | |
tree | 98bfbe7260eae1cffba33107bd19379cadad2b11 /win/C#/frmDownload.cs | |
parent | 9cfe126a970a4a7c544b8142224675a93637d31e (diff) |
WinGui:
- Code cleanup
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2106 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmDownload.cs')
-rw-r--r-- | win/C#/frmDownload.cs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/win/C#/frmDownload.cs b/win/C#/frmDownload.cs index e055140fe..8b23df92b 100644 --- a/win/C#/frmDownload.cs +++ b/win/C#/frmDownload.cs @@ -15,7 +15,7 @@ namespace Handbrake {
public partial class frmDownload : Form
{
- private Thread downloadThread;
+ private readonly Thread downloadThread;
private Stream responceStream;
private Stream loacalStream;
private HttpWebRequest webRequest;
@@ -55,7 +55,7 @@ namespace Handbrake responceStream = wcDownload.OpenRead(hbUpdate);
loacalStream = new FileStream(tempPath, FileMode.Create, FileAccess.Write, FileShare.None);
- int bytesSize = 0;
+ int bytesSize;
byte[] downBuffer = new byte[2048];
long flength = 0;
@@ -63,16 +63,16 @@ namespace Handbrake {
loacalStream.Write(downBuffer, 0, bytesSize);
flength = loacalStream.Length;
- this.Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { loacalStream.Length, fileSize });
+ Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { loacalStream.Length, fileSize });
}
responceStream.Close();
loacalStream.Close();
if (flength != fileSize)
- this.Invoke(new DownloadFailedCallback(this.downloadFailed));
+ Invoke(new DownloadFailedCallback(this.downloadFailed));
else
- this.Invoke(new DownloadCompleteCallback(this.downloadComplete));
+ Invoke(new DownloadCompleteCallback(this.downloadComplete));
}
catch (Exception)
{
@@ -91,7 +91,7 @@ namespace Handbrake }
catch (Exception exc)
{
- MessageBox.Show("Integer Conversion Error On Download \n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show("Integer Conversion Error On Download \n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -101,8 +101,7 @@ namespace Handbrake btn_cancel.Text = "Close";
string tempPath = Path.Combine(Path.GetTempPath(), "handbrake-setup.exe");
-
- Process startInstall = Process.Start(tempPath);
+ Process.Start(tempPath);
this.Close();
Application.Exit();
}
|