public static void beginRestore(ACommunicationWindow parent, List<Archive> archives) { string extrasave = ProgressHandler.message; ProgressHandler.saveMessage(); parent.hideInterface(); if (archives.Count > 1 && !TranslatingRequestHandler.Request(RequestType.Question,"RestoreMultipleArchives").Cancelled ) { Restore.RestoreProgramHandler.use_defaults = true; } foreach (Archive archive in archives) { if (Restore.RestoreProgramHandler.overall_stop) { break; } Restore.RestoreWindow restore = new Restore.RestoreWindow(archive, parent); if (restore.ShowDialog() == true) { Core.redetect_games = true; } } Restore.RestoreProgramHandler.use_defaults = false; Restore.RestoreProgramHandler.overall_stop = false; // Restore.RestoreProgramHandler.default_user = null; if (Restore.RestoreProgramHandler.unsuccesfull_restores.Count > 0) { StringBuilder fail_list = new StringBuilder(); foreach (string failed in Restore.RestoreProgramHandler.unsuccesfull_restores) { fail_list.AppendLine(failed); } TranslatingMessageHandler.SendError("RestoreSomeFailed", fail_list.ToString()); } parent.showInterface(); ProgressHandler.message = extrasave; }
public static void beginRestore(AViewWindow parent, List <Archive> archives) { string extrasave = ProgressHandler.message; ProgressHandler.saveMessage(); parent.hideInterface(); if (archives.Count > 1 && !TranslatingRequestHandler.Request(RequestType.Question, "RestoreMultipleArchives").Cancelled) { Restore.RestoreProgramHandler.use_defaults = true; } foreach (Archive archive in archives) { if (Restore.RestoreProgramHandler.overall_stop) { break; } Restore.RestoreWindow restore = new Restore.RestoreWindow(archive, parent); restore.ShowDialog(); switch (restore.Result) { case RestoreResult.Success: Core.redetect_games = true; break; case RestoreResult.Cancel: case RestoreResult.Failed: case RestoreResult.ElevationFailed: break; } } Restore.RestoreProgramHandler.use_defaults = false; Restore.RestoreProgramHandler.overall_stop = false; // Restore.RestoreProgramHandler.default_user = null; if (Restore.RestoreProgramHandler.unsuccesfull_restores.Count > 0) { StringBuilder fail_list = new StringBuilder(); foreach (string failed in Restore.RestoreProgramHandler.unsuccesfull_restores) { fail_list.AppendLine(failed); } TranslatingMessageHandler.SendError("RestoreSomeFailed", fail_list.ToString()); } parent.showInterface(); ProgressHandler.message = extrasave; }