private static void Updateavailable(FreshKeeper keeper, Update update) { ShowUpdateDetails frm = new ShowUpdateDetails(); //frm.SetUpdate(update); Application.Run(frm); }
public static int Main(string[] args) { Application.EnableVisualStyles(); Application.DoEvents(); if (Array.IndexOf(args, "ADMINISTRATION") == 0) { OpenFileDialog dlg = new OpenFileDialog(); dlg.FileName = "updates.xml"; dlg.Filter = "Update files (*.xml)|*.xml|All files (*.*)|*.*"; dlg.CheckFileExists = false; dlg.CheckPathExists = true; if (dlg.ShowDialog() != DialogResult.OK) { return(0); } UpdateAdministration dlg2 = new UpdateAdministration(); dlg2.UpdateFile = dlg.FileName; Application.Run(dlg2); return(0); } FreshKeeper keeper = new FreshKeeper(); keeper.Updateavailable += new FreshKeeper.UpdateavailableEvent(Updateavailable); keeper.UpdateError += new FreshKeeper.UpdateErrorEvent(ErrorOccured); keeper.CheckForUpdates(true); return(0); }
public static int Main(string[] args) { Application.EnableVisualStyles(); Application.DoEvents(); if (Array.IndexOf(args, "ADMINISTRATION") == 0) { OpenFileDialog dlg = new OpenFileDialog(); dlg.FileName = "updates.xml"; dlg.Filter = "Update files (*.xml)|*.xml|All files (*.*)|*.*"; dlg.CheckFileExists = false; dlg.CheckPathExists = true; if (dlg.ShowDialog() != DialogResult.OK) return 0; UpdateAdministration dlg2 = new UpdateAdministration(); dlg2.UpdateFile = dlg.FileName; Application.Run(dlg2); return 0; } FreshKeeper keeper = new FreshKeeper(); keeper.Updateavailable += new FreshKeeper.UpdateavailableEvent(Updateavailable); keeper.UpdateError += new FreshKeeper.UpdateErrorEvent(ErrorOccured); keeper.CheckForUpdates(true); return 0; }
private static void ErrorOccured(FreshKeeper keeper, Exception ex) { MessageBox.Show("Failed to check for updates: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); }