forked from V-Modder/SharpUpdate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SharpUpdateAcceptForm.cs
79 lines (70 loc) · 2.76 KB
/
SharpUpdateAcceptForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Windows.Forms;
using System.Globalization;
using System.Resources;
namespace SharpUpdate
{
/// <summary>
/// Form to prompt the user to accept the update
/// </summary>
internal partial class SharpUpdateAcceptForm : Form
{
/// <summary>
/// The program to update's info
/// </summary>
private ISharpUpdatable applicationInfo;
/// <summary>
/// The update info from the update.xml
/// </summary>
private SharpUpdateXml updateInfo;
/// <summary>
/// The update info display form
/// </summary>
private SharpUpdateInfoForm updateInfoForm;
/// <summary>
/// Creates a new SharpUpdateAcceptForm
/// </summary>
/// <param name="applicationInfo"></param>
/// <param name="updateInfo"></param>
internal SharpUpdateAcceptForm(ISharpUpdatable applicationInfo, SharpUpdateXml updateInfo)
{
InitializeComponent();
try
{
this.applicationInfo = applicationInfo;
this.updateInfo = updateInfo;
this.Text = SharpUpdate.LanguageFile._default.SharpUpdateAcceptForm_Title;
this.lblUpdateAvail.Text = SharpUpdate.LanguageFile._default.SharpUpdateAcceptForm_lblUpdateAvail;
this.lblNewVersion.Text = String.Format(SharpUpdate.LanguageFile._default.SharpUpdateAcceptForm_lblNewVersion, this.updateInfo.Version.ToString());
this.btnYes.Text = SharpUpdate.LanguageFile._default.SharpUpdateAcceptForm_btnYes;
this.btnNo.Text = SharpUpdate.LanguageFile._default.SharpUpdateAcceptForm_btnNo;
this.btnDetails.Text = SharpUpdate.LanguageFile._default.SharpUpdateAcceptForm_btnDetails;
}
catch (Exception ee)
{
int dds = 0;
}
// Assigns the icon if it isn't null
if (this.applicationInfo.ApplicationIcon != null)
this.Icon = this.applicationInfo.ApplicationIcon;
// Adds the update version # to the form
}
private void btnYes_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Yes;
this.Close();
}
private void btnNo_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.No;
this.Close();
}
private void btnDetails_Click(object sender, EventArgs e)
{
if (this.updateInfoForm == null)
this.updateInfoForm = new SharpUpdateInfoForm(this.applicationInfo, this.updateInfo);
// Shows the details form
this.updateInfoForm.ShowDialog(this);
}
}
}