Exemple #1
0
        public static void ReportExceptionToUser(string additionalMessage, Exception e)
        {
            string arg = MakeFullErrorMessage(additionalMessage, e);

            Log.Error($"{arg}\n{e.StackTrace}");
            AnalyticsManager.LogError(additionalMessage, e);
        }
Exemple #2
0
 public static void MigrateDataFromIsolatedStorageWithDialog()
 {
     try
     {
         if (Storage.DirectoryExists("data:/.config/.isolated-storage"))
         {
             Log.Information("1.26 data found, starting migration to 1.27.");
             BusyDialog dialog = new BusyDialog("Please wait", "Migrating 1.26 data to 1.27 format...");
             DialogsManager.ShowDialog(null, dialog);
             Task.Run(delegate
             {
                 string empty  = string.Empty;
                 string empty2 = string.Empty;
                 try
                 {
                     int num = MigrateFolder("data:/.config/.isolated-storage", "data:");
                     empty   = "Migration Successful";
                     empty2  = $"{num} file(s) were migrated from 1.26 to 1.27.";
                     AnalyticsManager.LogEvent("[Migration to 1.27]", new AnalyticsParameter("Details", empty2));
                 }
                 catch (Exception ex2)
                 {
                     empty  = "Migration Failed";
                     empty2 = ex2.Message;
                     Log.Error("Migration to 1.27 failed, reason: {0}", ex2.Message);
                     AnalyticsManager.LogError("Migration to 1.27 failed", ex2);
                 }
                 DialogsManager.HideDialog(dialog);
                 DialogsManager.ShowDialog(null, new MessageDialog(empty, empty2, LanguageControl.Get("Usual", "ok"), null, null));
                 Dispatcher.Dispatch(delegate
                 {
                     SettingsManager.LoadSettings();
                 });
             });
         }
     }
     catch (Exception ex)
     {
         Log.Error("Failed to migrate data. Reason: {0}", ex.Message);
         AnalyticsManager.LogError("Migration to 1.27 failed", ex);
     }
 }