public MainForm() { InitializeComponent(); UpdatePing(); // Integrate WinSparkle updater WinSparkle.win_sparkle_set_appcast_url("https://natechung.me/trayping/appcast.xml"); // WinSparkle.win_sparkle_set_app_details("Company","App", "Version"); // THIS CALL NOT IMPLEMENTED YET WinSparkle.win_sparkle_init(); // Set WinSparkle to check for update every 1 hour RegistryKey myKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Avion\\TrayPing\\WinSparkle", true); if (myKey != null) { myKey.SetValue("UpdateInterval", "3600", RegistryValueKind.String); myKey.Close(); } }
// What happens when user right clicks tray icon then, Exit private void Exit_Option_Click(object sender, EventArgs e) { string pingLowString = pingLow.ToString(); string pingMidString = pingMid.ToString(); // Save user radio selection and window location Properties.Settings.Default["Location"] = this.Location; Properties.Settings.Default["userRadio1"] = radioButton1.Checked; Properties.Settings.Default["userRadio2"] = radioButton2.Checked; Properties.Settings.Default["lowIPsetting"] = pingLowString; //lowIPsetting; Properties.Settings.Default["midIPsetting"] = pingMidString; // midIPsetting; Properties.Settings.Default.Save(); // Remove the icon from the system tray. notifyIcon1.Dispose(); WinSparkle.win_sparkle_cleanup(); // Close Application Environment.Exit(1); // Close the main Frame Application.Exit(); }
// Call winsparkle update process with UI private void checkForUpdateToolStripMenuItem_Click(object sender, EventArgs e) { WinSparkle.win_sparkle_check_update_with_ui(); }