Exemple #1
0
        /// <summary>
        /// Loads necessary data and perfor initialisation checks
        /// </summary>
        private void InitialiseApp()
        {
            try
            {
                SetLicenseInfo();
                var isDbUpgraded = AppUtility.UpdateSchema();

                if (!isDbUpgraded)
                {
                    AppUtility.MigrateXmlDataToDatabase();
                    ReminderUtility.ClearAllRemindersOnUpgrade();
                    BirthdayUtility.SaveLocalCards();
                }

                UpdateLocalizedRes();

                CheckFriendBirthdayFile();
            }
            catch (Exception ex)
            {
                MessageBox.Show(AppResources.ErrAppInitialise, AppResources.ErrInitialiseTitle, MessageBoxButton.OK);
                AppLog.WriteToLog(DateTime.Now, "Error during initialisation. Error : " + ex.Message + ". Stack : " + ex.StackTrace, LogLevel.Error);
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
            }
        }