コード例 #1
0
 private void Auth_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (status != AuthFormStatus.Completed)
     {
         status = AuthFormStatus.Cancelled;
         Application.Exit();
     }
 }
コード例 #2
0
        private void authorize_button_click(object sender, EventArgs e)
        {
            login    = this.login_textbox.Text;
            password = this.password_textbox.Text;
            bool savePasswordChecked = this.save_pass.Checked;

            if (project_combo.SelectedIndex == -1)
            {
                MessageBox.Show(T("Choose project!"));
                return;
            }

            domain = project_combo.Items[project_combo.SelectedIndex].ToString(); string wikin = domain;
            SiteManagerClass.current = domain;
            foreach (DictionaryEntry dd in SiteManagerClass.table)
            {
                if (dd.Key.Equals(domain))
                {
                    domain = dd.Value.ToString();
                }
            }

            if (login.Equals("") || password.Equals(""))
            {
                MessageBox.Show(T("Check your login and password!"));
                return;
            }

            if (Options.GetOptionInt(Options.SAVE_PASS) != (savePasswordChecked ? 1 : 0))
            {
                Options.SetOption(Options.SAVE_PASS, (savePasswordChecked ? 1 : 0) + "");
            }

            if (Version.single)
            {
                if (savePasswordChecked)
                {
                    Properties.Settings.Default.i1 = Tools.xor(login_textbox.Text); Properties.Settings.Default.i2 = Tools.xor(password_textbox.Text); Properties.Settings.Default.Save();
                }
                else
                {
                    Properties.Settings.Default.i1 = Tools.xor(login_textbox.Text);
                    Properties.Settings.Default.i2 = "";
                }
            }
            Options.SetOption("wiki", wikin);
            status = AuthFormStatus.Completed;
            Options.SaveOptions();
            this.Visible = false;
            this.Close();
        }