Beispiel #1
0
        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;
        }