2 using System.Diagnostics;
4 using System.Windows.Forms;
6 namespace AppLimit.NetSparkle
8 public partial class NetSparkleForm : Form
10 NetSparkleAppCastItem _currentItem;
12 public NetSparkleForm(NetSparkleAppCastItem item, Image appIcon, Icon windowIcon)
14 InitializeComponent();
19 NetSparkleBrowser.AllowWebBrowserDrop = false;
20 NetSparkleBrowser.AllowNavigation = false;
27 lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName);
28 lblInfoText.Text = lblInfoText.Text.Replace("APP", item.AppName + " " + item.Version);
29 lblInfoText.Text = lblInfoText.Text.Replace("OLDVERSION", item.AppVersionInstalled);
31 if (item.ReleaseNotesLink != null && item.ReleaseNotesLink.Length > 0 )
32 NetSparkleBrowser.Navigate(item.ReleaseNotesLink);
34 RemoveReleaseNotesControls();
37 imgAppIcon.Image = appIcon;
39 if (windowIcon != null)
43 public void RemoveReleaseNotesControls()
45 if (label3.Parent == null)
49 Size newSize = new Size(this.Size.Width, this.Size.Height - label3.Height - panel1.Height);
51 // remove the no more needed controls
52 label3.Parent.Controls.Remove(label3);
53 NetSparkleBrowser.Parent.Controls.Remove(NetSparkleBrowser);
54 panel1.Parent.Controls.Remove(panel1);
57 /*this.MinimumSize = newSize;
58 this.Size = this.MinimumSize;
59 this.MaximumSize = this.MinimumSize;*/
63 private void skipButton_Click(object sender, EventArgs e)
65 // set the dialog result to no
66 this.DialogResult = DialogResult.No;
72 private void buttonRemind_Click(object sender, EventArgs e)
74 // set the dialog result ot retry
75 this.DialogResult = DialogResult.Retry;
81 private void updateButton_Click(object sender, EventArgs e)
83 // set the result to yes
84 DialogResult = DialogResult.Yes;