Пример #1
0
        public static void LoadCDB()
        {
            _windowload = new UpdateCardsStuffWindow(true);
            _windowload.Show();
            Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() => _windowload.Activate()));

            CardManager.LoadingFinished += CardManager_LoadingFinished;
            CardManager.LoadingProgress += CardManager_LoadingProgress;
            Task.Run(() => CardManager.LoadCDB(Path.Combine(path, "BattleCityAlpha", "cards.cdb"), true, true));
        }
Пример #2
0
        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()));
        }