void MainWindow_Loaded(object sender, RoutedEventArgs e) { ResetSettings(); mySettings.SetNewPallette(myUserPrefs.CurrentPallette); mySettings.SetGhostFont(myUserPrefs.CurrentGhostFont.Name); if (lstLatestVersions.Count > 0) { //combine the patch notes string strPatchNotes = ""; foreach (LauncherData.LauncherVersion theVersion in lstLatestVersions) { strPatchNotes += theVersion.VersionNumber + " (" + theVersion.DateCreated.ToString("yyyy-MM-dd HH:mm:ss") + ")" + Environment.NewLine; strPatchNotes += theVersion.PatchNotes + Environment.NewLine + Environment.NewLine; } this.Dispatcher.BeginInvoke(new System.Windows.Forms.MethodInvoker(delegate() { lblMessage.Text = myLocales.CurrentLocale.DownloadingUpdateOne + Environment.NewLine + myLocales.CurrentLocale.DownloadingUpdateTwo; lblMessage.Text += Environment.NewLine + Environment.NewLine + strPatchNotes; brdMessageBox.Visibility = Visibility.Visible; messageboxOK.Visibility = Visibility.Collapsed; ServiceMaker myServiceMaker = new ServiceMaker(); ApplicationUpdates myApplicationUpdates = new ApplicationUpdates(myServiceMaker.GetServiceClient()); myApplicationUpdates.OnDownloadProgress += new EventHandler <ApplicationUpdates.DownloadProgressEventArgs>(myApplicationUpdates_OnDownloadProgress); myApplicationUpdates.OnDownloadComplete += new EventHandler <ApplicationUpdates.DownloadCompleteEventArgs>(myApplicationUpdates_OnDownloadComplete); myApplicationUpdates.UpdateToLatestVersion(this.Dispatcher, lstLatestVersions.First()); prgDownload.Visibility = Visibility.Visible; prgDownload.Maximum = lstLatestVersions.First().FileSize; prgDownload.Value = 0; }), System.Windows.Threading.DispatcherPriority.Normal); } else { if ((myUserPrefs.DefaultServer != Guid.Empty) && (myUserPrefs.DefaultServerInformation != null)) { //chek the game launcher, by default scGameLauncher.IsChecked = true; } else { scChooseGalaxy.IsChecked = true; } } }