Пример #1
0
        private void _worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            // Just wait - the game monitor checks the character periodically
            // and the account manager is subscribed on it for changes
            // _viewModel.ReloadCharacters();
            // _viewModel.NotifyAvailableCharactersChanged();
            // It would be nice to call NotifyAvailableCharactersChanged()
            // But the properties haven't actually changed yet
            // The characters file needs to be reread from disk & the properties updated from it
            // LoadUserAccounts();

            try
            {
                if (e.Cancelled)
                {
                    lblWorkerProgress.Content = "User Cancelled";
                    ClearLaunchQueue();
                }
                else if (e.Error != null)
                {
                    lblWorkerProgress.Content = string.Format("Error: {0}", e.Error.Message);
                }
                else
                {
                    lblWorkerProgress.Content = "Launcher Complete";
                }
                _gameSessionMap.EndAllLaunchingSessions();
            }
            finally
            {
                EnableInterface(true);
                btnCancel.IsEnabled = false;
            }
        }