X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmDownload.cs;h=8b23df92b9d11db8116cfd6b1a844c05c7cbd725;hb=b4464b6d962bb939a8f38b4d50057c441ab48111;hp=8fe53ba4f5666195faf11e6f5b2ff7f2c7dc568a;hpb=8d18c8508c0b708c9d05d814f16b32b5bf92654f;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmDownload.cs b/win/C#/frmDownload.cs index 8fe53ba4..8b23df92 100644 --- a/win/C#/frmDownload.cs +++ b/win/C#/frmDownload.cs @@ -5,7 +5,6 @@ It may be used under the terms of the GNU General Public License. */ using System; -using System.Collections.Generic; using System.Windows.Forms; using System.Net; using System.IO; @@ -16,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; @@ -56,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; @@ -64,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) { @@ -92,7 +91,7 @@ namespace Handbrake } catch (Exception exc) { - MessageBox.Show("Integer Convertion 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); } } @@ -102,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(); }