private static void UpdateCardsStuff(string[] updatefilelines) { _windowload = new UpdateCardsStuffWindow(false); _windowload.Show(); Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() => _windowload.Activate())); FormExecution.Client_PopMessageBox("Un mise à jour mineure est disponible !", "Mise à jour"); List <string> updatesToDo = new List <string>(); int i = 0; while (updatefilelines[i] != FormExecution.ClientConfig.CardsStuffVersion.ToString() && i < updatefilelines.Length - 1) { updatesToDo.Add(updatefilelines[i]); i++; } CardsUpdateDownloader.LoadingProgress += CardsUpdateDownloader_LoadingProgress; CardsUpdateDownloader.UpdateCompleted += CardsUpdateDownloader_UpdateCompleted; Task.Run(() => CardsUpdateDownloader.DownloadUpdates(updatesToDo.ToArray())); }
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { logger.Error("UNHANDLED EXCEPTION - {0}", e.Exception.ToString()); FormExecution.Client_PopMessageBoxShowDialog("Une erreur s'est produite.", "Problème"); Application.Current.Dispatcher.Invoke(Application.Current.Shutdown); }