private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { string errorMsg = e.Result as string; progressBar.Visible = false; if (string.IsNullOrEmpty(errorMsg)) { errorTxt.Visible = false; errorTxt.Text = string.Empty; // change the visibility of buttons of top menu and right-click PluginBase.Current.DisplayLoggedInButtons(); // Close the window LoginClicked = false; PluginBase.CloseForm(this); } else { errorTxt.Text = errorMsg; errorTxt.Visible = true; LoginClicked = false; } }
private void publishw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { string errorMsg = e.Result as string; progressBar.Visible = false; if (string.IsNullOrEmpty(errorMsg)) { ErrorTxt.Text = string.Empty; ErrorTxt.Visible = false; // Close the window PluginBase.CloseForm(this); } else { ErrorTxt.Text = errorMsg; ErrorTxt.Visible = true; } publishClicked = false; }
private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { AboutResultReport res = e.Result as AboutResultReport; progressBar.Visible = false; if (!res.newServer.Equals(res.oldServer, StringComparison.InvariantCultureIgnoreCase)) // we have changed something { User us = res.currentUser; IPluginManager thisPackage = PluginBase.Current; ClientUtils.CloseObsoleteFormsFromAbout(thisPackage); // cleanup and close obsolete objects if ((us == null) || (us.ID <= 0)) { string errorMsg = res.error; if (!errorMsg.IsNullOrWhiteSpaceOrEOF()) { SetError(errorMsg); // only display the message } else { // invalid login on the new server! ClientUtils.ManageInvalidLoginOnNewServerFromAbout(thisPackage, UserPlugin.Current, res.oldServer, res.newServer); // Close the window PluginBase.CloseForm(this); } UpdateClicked = false; return; } // save new server path UserPlugin.Current.SaveUserPreferences(); } UpdateClicked = false; }