Пример #1
0
        private static void Updateavailable(FreshKeeper keeper, Update update)
        {
            ShowUpdateDetails frm = new ShowUpdateDetails();

            //frm.SetUpdate(update);
            Application.Run(frm);
        }
Пример #2
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);
        }
Пример #3
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;
        }
Пример #4
0
 private static void ErrorOccured(FreshKeeper keeper, Exception ex)
 {
     MessageBox.Show("Failed to check for updates: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
Пример #5
0
 private static void Updateavailable(FreshKeeper keeper, Update update)
 {
     ShowUpdateDetails frm = new ShowUpdateDetails();
     //frm.SetUpdate(update);
     Application.Run(frm);
 }
Пример #6
0
 private static void ErrorOccured(FreshKeeper keeper, Exception ex)
 {
     MessageBox.Show("Failed to check for updates: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
 }