示例#1
0
        private void CheckSettings(bool exit = false)
        {
            var set = Settings.Default;

            if (string.IsNullOrEmpty(set.DBHost) || string.IsNullOrEmpty(set.DBUsername) || string.IsNullOrEmpty(set.DBPassword) || string.IsNullOrEmpty(set.DBAuthName) ||
                string.IsNullOrEmpty(set.DBCharName) || string.IsNullOrEmpty(set.DBWorldName))
            {
                if (!exit)
                {
                    using (var wizard = new SetupWizard())
                    {
                        Hide();
                        wizard.FormClosing += wizard_FormClosing;
                        wizard.ShowDialog();
                    }
                }
                else
                {
                    Application.Exit();
                }
            }
            else if ((ServerType)set.ServerType == ServerType.Local)
            {
                if (string.IsNullOrEmpty(set.ServerFolder))
                {
                    if (!exit)
                    {
                        using (var wizard = new SetupWizard())
                        {
                            Hide();
                            wizard.FormClosing += wizard_FormClosing;
                            wizard.ShowDialog();
                        }
                    }
                    else
                    {
                        Application.Exit();
                    }
                }
            }
            else if ((ServerType)set.ServerType == ServerType.RemoteAccess)
            {
                if (string.IsNullOrEmpty(set.RAUsername) || string.IsNullOrEmpty(set.RAPassword))
                {
                    if (!exit)
                    {
                        using (var wizard = new SetupWizard())
                        {
                            Hide();
                            wizard.FormClosing += wizard_FormClosing;
                            wizard.ShowDialog();
                        }
                    }
                    else
                    {
                        Application.Exit();
                    }
                }
            }
        }
示例#2
0
 private void setupWizardButton_Click(object sender, EventArgs e)
 {
     using (var sWizard = new SetupWizard())
     {
         sWizard.FormClosing += sWizard_FormClosing;
         sWizard.ShowDialog();
     }
 }