Example #1
0
        void UpdateCheckerCallback(Utils.UpdateChecker uc, Utils.UpdateCheckerResult result)
        {
            try
            {
                if (!result.Success)
                {
                    return;
                }

                V8Reader.Properties.Settings.Default.LastUpdateCheck = DateTime.Now.Date;
                V8Reader.Properties.Settings.Default.Save();

                if (result.Updates.Count > 0)
                {
                    var answer = MessageBox.Show("Обнаружены новые версии. Обновить программу?", "Обновление", MessageBoxButton.YesNo, MessageBoxImage.Question);
                    if (answer == MessageBoxResult.Yes)
                    {
                        var UpdWnd = new Utils.UpdatesWnd();
                        UpdWnd.Updates = result.Updates;
                        UpdWnd.Show();
                    }
                }
            }
            catch
            {
                #if DEBUG
                throw;
                                #endif
            }
        }
        void UpdateCheckerCallback(Utils.UpdateChecker uc, Utils.UpdateCheckerResult result)
        {
            try
            {
                if (!result.Success)
                {
                    throw result.Exception;
                }

                if (result.Updates.Count > 0)
                {
                    var UpdWnd = new Utils.UpdatesWnd();
                    UpdWnd.Updates = result.Updates;
                    UpdWnd.Owner   = this;
                    UpdWnd.Show();
                }
                else
                {
                    MessageBox.Show("Новых версий нет.", "V8 Viewer", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch (System.Net.WebException webExc)
            {
                MessageBox.Show(webExc.ToString());
                return;
            }
            catch (Exception exc)
            {
                Utils.UIHelper.DefaultErrHandling(exc);
            }
        }