X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmDownload.cs;h=8b23df92b9d11db8116cfd6b1a844c05c7cbd725;hb=84278065e1b8cdc0efbfb1e29178a9daa62f9b43;hp=e055140fe550d782eadf8c9d36c06fd4857e46e7;hpb=f97a2e4f680a1a71481d410e6c30b5899f23ed61;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmDownload.cs b/win/C#/frmDownload.cs index e055140f..8b23df92 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(); }