X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmUpdater.cs;h=7d56c587efc0e1e673f9d6fbb96db97f41f4d8ac;hb=32219d93ec8fcf0db6f7ca5d6045419882563951;hp=97a5c9a647d5662d3bfdfddf1e51c20d7c64ab9d;hpb=7137276632ab5e5c4a269d6bfc58170e04396f15;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmUpdater.cs b/win/C#/frmUpdater.cs index 97a5c9a6..7d56c587 100644 --- a/win/C#/frmUpdater.cs +++ b/win/C#/frmUpdater.cs @@ -1,58 +1,103 @@ /* frmUpdater.cs $ - - This file is part of the HandBrake source code. - Homepage: . - It may be used under the terms of the GNU General Public License. */ - -using System; -using System.Windows.Forms; -using Handbrake.Functions; + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ namespace Handbrake { + using System; + using System.Windows.Forms; + using Functions; + + /// + /// A window to display update information. + /// public partial class frmUpdater : Form { - AppcastReader appcast = new AppcastReader(); - public frmUpdater() + /// + /// An instance of the Appcast Reader + /// + private readonly AppcastReader appcast; + + /// + /// Initializes a new instance of the class. + /// + /// + /// The appcast reader. + /// + public frmUpdater(AppcastReader reader) { InitializeComponent(); - appcast.getInfo(); // Initializes the appcast - getRss(); - setVersions(); + appcast = reader; + GetRss(); + SetVersions(); } - private void getRss() + /// + /// Get the RSS feed + /// + private void GetRss() { - wBrowser.Url = appcast.descriptionUrl; + wBrowser.Url = appcast.DescriptionUrl; } - private void setVersions() + /// + /// Set the versions + /// + private void SetVersions() { - string old = "(You have: " + Properties.Settings.Default.hb_version.Trim() + " / " + Properties.Settings.Default.hb_build.ToString().Trim() + ")"; - string newBuild = appcast.version.Trim() + " (" + appcast.build + ")"; + string old = "(You have: " + Properties.Settings.Default.hb_version.Trim() + " / " + + Properties.Settings.Default.hb_build.ToString().Trim() + ")"; + string newBuild = appcast.Version.Trim() + " (" + appcast.Build + ")"; lbl_update_text.Text = "HandBrake " + newBuild + " is now available. " + old; } - private void btn_installUpdate_Click(object sender, EventArgs e) + /// + /// Handle the Install Update button click event. + /// + /// + /// The sender. + /// + /// + /// The EventArgs. + /// + private void BtnInstallUpdateClick(object sender, EventArgs e) { - frmDownload download = new frmDownload(appcast.downloadFile); - download.Show(); + frmDownload download = new frmDownload(appcast.DownloadFile); + download.ShowDialog(); this.Close(); } - private void btn_remindLater_Click(object sender, EventArgs e) + /// + /// Handle the Remind Later button click event + /// + /// + /// The sender. + /// + /// + /// The EventArgs. + /// + private void BtnRemindLaterClick(object sender, EventArgs e) { this.Close(); } - private void btn_skip_Click(object sender, EventArgs e) + /// + /// Handle the Skip update button click event + /// + /// + /// The sender. + /// + /// + /// The e. + /// + private void BtnSkipClick(object sender, EventArgs e) { - Properties.Settings.Default.skipversion = int.Parse(appcast.build); + Properties.Settings.Default.skipversion = int.Parse(appcast.Build); Properties.Settings.Default.Save(); this.Close(); } - } } \ No newline at end of file