コード例 #1
0
        private void boton_Agregar_Cuenta_Click(object sender, EventArgs e)
        {
            if (textBox_Nombre_Cuenta.TextLength != 0 && textBox_Password.TextLength != 0)
            {
                if (GlobalConf.get_Cuenta(textBox_Nombre_Cuenta.Text) != null)
                {
                    MessageBox.Show("Ya existe una cuenta con el nombre de cuenta", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                GlobalConf.agregar_Cuenta(textBox_Nombre_Cuenta.Text, textBox_Password.Text, comboBox_Servidor.SelectedItem.ToString(), Convert.ToInt32(seleccion_id_personaje.Value));
                cargar_Cuentas_Lista();

                textBox_Nombre_Cuenta.Clear();
                textBox_Password.Clear();
                seleccion_id_personaje.Value = 1;

                if (checkBox_Agregar_Retroceder.Checked)
                {
                    tabControlPrincipalCuentas.SelectedIndex = 0;
                }
                GlobalConf.guardar_Configuracion();
            }
            else
            {
                tableLayoutPanel6.Controls.OfType <TableLayoutPanel>().ToList().ForEach(panel =>
                {
                    panel.Controls.OfType <TextBox>().ToList().ForEach(textbox =>
                    {
                        textbox.BackColor = string.IsNullOrEmpty(textbox.Text) ? Color.Red : Color.White;
                    });
                });
            }
        }
コード例 #2
0
        // Token: 0x060004E1 RID: 1249 RVA: 0x0001E674 File Offset: 0x0001CA74
        private void boton_Agregar_Cuenta_Click(object sender, EventArgs e)
        {
            bool flag = GlobalConf.get_Cuenta(this.textBox_Nombre_Cuenta.Text) != null && GlobalConf.mostrar_mensajes_debug;

            if (flag)
            {
                MessageBox.Show("Il existe déjà un compte avec ce nom de compte", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            else
            {
                bool tiene_errores = false;
                Action <TextBox> < > 9__1;
                this.tableLayoutPanel6.Controls.OfType <TableLayoutPanel>().ToList <TableLayoutPanel>().ForEach(delegate(TableLayoutPanel panel)
                {
                    List <TextBox> list = panel.Controls.OfType <TextBox>().ToList <TextBox>();
                    Action <TextBox> action;
                    if ((action = < > 9__1) == null)
                    {
                        action = (< > 9__1 = delegate(TextBox textbox)
                        {
                            Console.WriteLine("TextBox: " + textbox.Name);
                            bool flag3 = textbox.Name != "textBox_nombre_personaje";
                            if (flag3)
                            {
                                bool flag4 = string.IsNullOrEmpty(textbox.Text) || textbox.Text.Split(new char[0]).Length > 1;
                                if (flag4)
                                {
                                    textbox.BackColor = Color.Red;
                                    tiene_errores = true;
                                }
                                else
                                {
                                    textbox.BackColor = Color.White;
                                }
                            }
                        });
                    }
                    list.ForEach(action);
                });
                bool flag2 = !tiene_errores;
                if (flag2)
                {
                    GlobalConf.agregar_Cuenta(this.textBox_Nombre_Cuenta.Text, this.textBox_Password.Text, this.comboBox_Servidor.SelectedItem.ToString(), this.textBox_nombre_personaje.Text);
                    this.cargar_Cuentas_Lista();
                    this.textBox_Nombre_Cuenta.Clear();
                    this.textBox_Password.Clear();
                    this.textBox_nombre_personaje.Clear();
                    bool @checked = this.checkBox_Agregar_Retroceder.Checked;
                    if (@checked)
                    {
                        this.tabControlPrincipalCuentas.SelectedIndex = 0;
                    }
                    GlobalConf.guardar_Configuracion();
                }
            }
        }
コード例 #3
0
        private void boton_Agregar_Cuenta_Click(object sender, EventArgs e)
        {
            if (GlobalConf.get_Cuenta(textBox_Nombre_Cuenta.Text) != null && GlobalConf.mostrar_mensajes_debug)
            {
                MessageBox.Show("Un compte existe déjà avec le nom du compte", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            bool tiene_errores = false;

            tableLayoutPanel6.Controls.OfType <TableLayoutPanel>().ToList().ForEach(panel =>
            {
                panel.Controls.OfType <TextBox>().ToList().ForEach(textbox =>
                {
                    if (string.IsNullOrEmpty(textbox.Text) || textbox.Text.Split(new char[0]).Length > 1)
                    {
                        textbox.BackColor = Color.Red;
                        tiene_errores     = true;
                    }
                    else
                    {
                        textbox.BackColor = Color.White;
                    }
                });
            });

            if (!tiene_errores)
            {
                GlobalConf.agregar_Cuenta(textBox_Nombre_Cuenta.Text, textBox_Password.Text, comboBox_Servidor.SelectedItem.ToString(), textBox_nombre_personaje.Text);
                cargar_Cuentas_Lista();

                textBox_Nombre_Cuenta.Clear();
                textBox_Password.Clear();
                textBox_nombre_personaje.Clear();

                if (checkBox_Agregar_Retroceder.Checked)
                {
                    tabControlPrincipalCuentas.SelectedIndex = 0;
                }

                GlobalConf.guardar_Configuracion();
            }
        }