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; }); }); } }
// Token: 0x060004F2 RID: 1266 RVA: 0x00020E00 File Offset: 0x0001F200 private void boton_opciones_guardar_Click(object sender, EventArgs e) { IPAddress ipaddress; bool flag = !IPAddress.TryParse(this.textBox_ip_servidor.Text, out ipaddress); if (flag) { this.textBox_ip_servidor.BackColor = Color.Red; } else { short num; bool flag2 = !short.TryParse(this.textBox_puerto_servidor.Text, out num); if (flag2) { this.textBox_puerto_servidor.BackColor = Color.Red; } else { GlobalConf.mostrar_mensajes_debug = this.checkBox_mensajes_debug.Checked; GlobalConf.ip_conexion = this.textBox_ip_servidor.Text; GlobalConf.puerto_conexion = short.Parse(this.textBox_puerto_servidor.Text); GlobalConf.guardar_Configuracion(); base.Close(); } } }
// 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(); } } }
private void eliminarToolStripMenuItem_Click(object sender, EventArgs e) { if (listViewCuentas.SelectedItems.Count > 0 && listViewCuentas.FocusedItem != null) { foreach (ListViewItem cuenta in listViewCuentas.SelectedItems) { GlobalConf.eliminar_Cuenta(cuenta.Index); cuenta.Remove(); } GlobalConf.guardar_Configuracion(); cargar_Cuentas_Lista(); } }
// Token: 0x060004E3 RID: 1251 RVA: 0x0001E7B0 File Offset: 0x0001CBB0 private void eliminarToolStripMenuItem_Click(object sender, EventArgs e) { bool flag = this.listViewCuentas.SelectedItems.Count > 0 && this.listViewCuentas.FocusedItem != null; if (flag) { foreach (object obj in this.listViewCuentas.SelectedItems) { ListViewItem listViewItem = (ListViewItem)obj; GlobalConf.eliminar_Cuenta(listViewItem.Index); listViewItem.Remove(); } GlobalConf.guardar_Configuracion(); this.cargar_Cuentas_Lista(); } }
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(); } }
private void boton_opciones_guardar_Click(object sender, EventArgs e) { if (!IPAddress.TryParse(textBox_ip_servidor.Text, out IPAddress address)) { textBox_ip_servidor.BackColor = Color.Red; return; } if (!short.TryParse(textBox_puerto_servidor.Text, out short puerto)) { textBox_puerto_servidor.BackColor = Color.Red; return; } GlobalConf.mostrar_mensajes_debug = checkBox_mensajes_debug.Checked; GlobalConf.ip_conexion = textBox_ip_servidor.Text; GlobalConf.puerto_conexion = short.Parse(textBox_puerto_servidor.Text); GlobalConf.guardar_Configuracion(); Close(); }
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($"Ingresa la nueva cuenta", "Modificar cuenta", cuenta.nombre_cuenta); if (!string.IsNullOrEmpty(nueva_cuenta)) { 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)) { cuenta.password = nueva_password; } break; default: //nombre del personaje string nuevo_personaje = Interaction.InputBox($"Ingresa el nombre del nuevo personaje", "Modificar nombre de personaje", cuenta.nombre_personaje); if (!string.IsNullOrEmpty(nuevo_personaje)) { cuenta.nombre_personaje = nuevo_personaje; } break; } GlobalConf.guardar_Configuracion(); cargar_Cuentas_Lista(); } }
// 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(); } }
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(); } }
private void modificar_Account(object sender, EventArgs e) { if (listViewAccounts.SelectedItems.Count == 1 && listViewAccounts.FocusedItem != null) { AccountConfiguration cuenta = GlobalConf.get_Account(listViewAccounts.SelectedItems[0].Index); switch (sender.ToString()) { case "Account": 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 Character", "Modificar nombre de Character", cuenta.nombre_personaje); cuenta.nombre_personaje = nuevo_personaje; break; } GlobalConf.guardar_Configuracion(); cargar_Accounts_Lista(); } }