-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSharpUpdateInfoForm.cs
46 lines (40 loc) · 1.6 KB
/
SharpUpdateInfoForm.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
using System;
using System.Windows.Forms;
using System.Globalization;
using System.Resources;
namespace SharpUpdate
{
/// <summary>
/// Form to show details about the update
/// </summary>
internal partial class SharpUpdateInfoForm : Form
{
/// <summary>
/// Creates a new SharpUpdateInfoForm
/// </summary>
internal SharpUpdateInfoForm(ISharpUpdatable applicationInfo, SharpUpdateXml updateInfo)
{
InitializeComponent();
// Sets the icon if it's not null
if (applicationInfo.ApplicationIcon != null)
this.Icon = applicationInfo.ApplicationIcon;
// Fill in the UI
this.Text = SharpUpdate.LanguageFile._default.SharpUpdateInfoForm_Title;
this.lblVersions.Text = String.Format(SharpUpdate.LanguageFile._default.SharpUpdateInfoForm_Version, applicationInfo.ApplicationAssembly.GetName().Version.ToString(),
updateInfo.Version.ToString());
this.lblDescription.Text = SharpUpdate.LanguageFile._default.SharpUpdateInfoForm_lblDescription;
this.txtDescription.Text = updateInfo.Description;
this.btnBack.Text = SharpUpdate.LanguageFile._default.SharpUpdateInfoForm_btnBack;
}
private void btnBack_Click(object sender, EventArgs e)
{
this.Close();
}
private void txtDescription_KeyDown(object sender, KeyEventArgs e)
{
// Only allow Cntrl - C to copy text
if (!(e.Control && e.KeyCode == Keys.C))
e.SuppressKeyPress = true;
}
}
}