Ejemplo n.º 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;
                    });
                });
            }
        }
Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 4
0
        private void modificar_Cuenta(object sender, EventArgs e)
        {
            if (listViewCuentas.SelectedItems.Count == 1 && listViewCuentas.FocusedItem != null)
            {
                CuentaConf cuenta = GlobalConf.get_Cuenta(listViewCuentas.SelectedItems[0].Index);

                if (cuenta == null)
                {
                    return;
                }

                switch (sender.ToString())
                {
                case "Cuenta":
                    string nueva_cuenta = Interaction.InputBox($"Ingresa la nueva cuenta", "Modificar cuenta", cuenta.nombre_cuenta);

                    if (!string.IsNullOrEmpty(nueva_cuenta) || nueva_cuenta.Split(new char[0]).Length == 0)
                    {
                        cuenta.nombre_cuenta = nueva_cuenta;
                    }
                    break;

                case "Contraseña":
                    string nueva_password = Interaction.InputBox($"Ingresa la nueva contraseña", "Modificar contraseña", cuenta.password);

                    if (!string.IsNullOrEmpty(nueva_password) || nueva_password.Split(new char[0]).Length == 0)
                    {
                        cuenta.password = nueva_password;
                    }
                    break;

                default:
                    string nuevo_personaje = Interaction.InputBox($"Ingresa el nombre del nuevo personaje", "Modificar nombre de personaje", cuenta.nombre_personaje);
                    cuenta.nombre_personaje = nuevo_personaje;
                    break;
                }

                GlobalConf.guardar();
                cargar_Cuentas_Lista();
            }
        }
Ejemplo n.º 5
0
        // Token: 0x060004E7 RID: 1255 RVA: 0x0001E930 File Offset: 0x0001CD30
        private void modificar_Cuenta(object sender, EventArgs e)
        {
            bool flag = this.listViewCuentas.SelectedItems.Count == 1 && this.listViewCuentas.FocusedItem != null;

            if (flag)
            {
                CuentaConf cuentaConf = GlobalConf.get_Cuenta(this.listViewCuentas.SelectedItems[0].Index);
                string     text       = sender.ToString();
                string     text2      = text;
                if (text2 != null)
                {
                    if (text2 == "Compte")
                    {
                        string text3 = Interaction.InputBox("Renseigne le nouveau compte", "Modifier compte", cuentaConf.nombre_cuenta, -1, -1);
                        bool   flag2 = !string.IsNullOrEmpty(text3) || text3.Split(new char[0]).Length == 0;
                        if (flag2)
                        {
                            cuentaConf.nombre_cuenta = text3;
                        }
                        goto IL_127;
                    }
                    if (text2 == "Mot de passe")
                    {
                        string text4 = Interaction.InputBox("Renseigne le mot de passe", "Modifier mdp", cuentaConf.password, -1, -1);
                        bool   flag3 = !string.IsNullOrEmpty(text4) || text4.Split(new char[0]).Length == 0;
                        if (flag3)
                        {
                            cuentaConf.password = text4;
                        }
                        goto IL_127;
                    }
                }
                string nombre_personaje = Interaction.InputBox("Change le nom du personnage a connecté", "Modifier le nom du personnage", cuentaConf.nombre_personaje, -1, -1);
                cuentaConf.nombre_personaje = nombre_personaje;
IL_127:
                GlobalConf.guardar_Configuracion();
                this.cargar_Cuentas_Lista();
            }
        }
Ejemplo n.º 6
0
        private void eliminarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listViewCuentas.FocusedItem == null || listViewCuentas.SelectedItems.Count <= 0)
            {
                return;
            }

            foreach (ListViewItem item in listViewCuentas.SelectedItems)
            {
                CuentaConf cuenta_conf = GlobalConf.get_Cuenta(item.Text);

                if (cuenta_conf == null)
                {
                    continue;
                }

                GlobalConf.eliminar_Cuenta(cuenta_conf);
                item.Remove();
            }

            GlobalConf.guardar();
            cargar_Cuentas_Lista();
        }
Ejemplo n.º 7
0
        private void modificar_Cuenta(object sender, EventArgs e)
        {
            if (listViewCuentas.SelectedItems.Count == 1 && listViewCuentas.FocusedItem != null)
            {
                CuentaConf cuenta = GlobalConf.get_Cuenta(listViewCuentas.SelectedItems[0].Index);

                switch (sender.ToString())
                {
                case "Cuenta":
                    string nueva_cuenta = Interaction.InputBox($"Entrez le nouveau compte", "Modifier le compte", cuenta.nombre_cuenta);

                    if (!string.IsNullOrEmpty(nueva_cuenta) || nueva_cuenta.Split(new char[0]).Length == 0)
                    {
                        cuenta.nombre_cuenta = nueva_cuenta;
                    }
                    break;

                case "Contraseña":
                    string nueva_password = Interaction.InputBox($"Entrez le nouveau mot de passe", "Changer le mot de passe", cuenta.password);

                    if (!string.IsNullOrEmpty(nueva_password) || nueva_password.Split(new char[0]).Length == 0)
                    {
                        cuenta.password = nueva_password;
                    }
                    break;

                default:
                    string nuevo_personaje = Interaction.InputBox($"Entrez le nouveau nom du personnage", "Modifier le nom du personnage", cuenta.nombre_personaje);
                    cuenta.nombre_personaje = nuevo_personaje;
                    break;
                }

                GlobalConf.guardar_Configuracion();
                cargar_Cuentas_Lista();
            }
        }