private void v1W_Load(object sender, EventArgs e) { try { WebClient client = new WebClient(); StreamReader sr = new StreamReader(client.OpenRead(v1efectos)); string linea = ""; efv1 = new ArrayList(); while ((linea = sr.ReadLine()) != null) { EfectosV1 v = new EfectosV1(); v.nombre = substringindexof(linea); v.invariante = substringindexof(sr.ReadLine()); v.ebase = substringindexof(sr.ReadLine()); v.textra = substringindexof(sr.ReadLine()); v.efecto1 = substringindexof(sr.ReadLine()); v.tefecto1 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade1 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr1 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.efecto2 = substringindexof(sr.ReadLine()); v.tefecto2 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade2 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr2 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.efecto3 = substringindexof(sr.ReadLine()); v.tefecto3 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade3 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr3 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.efecto4 = substringindexof(sr.ReadLine()); v.tefecto4 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade4 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr4 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.efecto5 = substringindexof(sr.ReadLine()); v.tefecto5 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade5 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr5 = Convert.ToInt32(substringindexof(sr.ReadLine())); efv1.Add(v); dbOnline.Items.Add(v.nombre); } sr.Close(); } catch { mW.errorMsg("Error accediendo a la base de datos on-line de efectos de la v1.\nSólo se podrá actuar localmente en esta sesión.");} FillWithLocalEffects(); // rellenar datagrid estilos persList = new ArrayList(); foreach (lineaASS lass in mW.al) if (!persList.Contains(lass.personaje)) persList.Add(lass.personaje); dataGridView1.RowCount = persList.Count; for (int i = 0; i < persList.Count; i++) { dataGridView1["Estilos", i].Value = persList[i]; dataGridView1["Check", i].Value = true; } }
private void FillDataFromEffect(EfectosV1 ef) { NombreEfecto.Text = ef.nombre; Invariante.Text = ef.invariante; EfBase.Text = ef.ebase; Efecto1.Text = ef.efecto1; Efecto1_Perc.Text = Convert.ToString(ef.tefecto1); Efecto1_TEI.Text = Convert.ToString(ef.tade1); Efecto1_TEF.Text = Convert.ToString(ef.tatr1); Efecto2.Text = ef.efecto2; Efecto2_Perc.Text = Convert.ToString(ef.tefecto2); Efecto2_TEI.Text = Convert.ToString(ef.tade2); Efecto2_TEF.Text = Convert.ToString(ef.tatr2); Efecto3.Text = ef.efecto3; Efecto3_Perc.Text = Convert.ToString(ef.tefecto3); Efecto3_TEI.Text = Convert.ToString(ef.tade3); Efecto3_TEF.Text = Convert.ToString(ef.tatr3); Efecto4.Text = ef.efecto4; Efecto4_Perc.Text = Convert.ToString(ef.tefecto4); Efecto4_TEI.Text = Convert.ToString(ef.tade4); Efecto4_TEF.Text = Convert.ToString(ef.tatr4); Efecto5.Text = ef.efecto5; Efecto5_Perc.Text = Convert.ToString(ef.tefecto5); Efecto5_TEI.Text = Convert.ToString(ef.tade5); Efecto5_TEF.Text = Convert.ToString(ef.tatr5); TextoAñadir.Text = ef.textra; }
private EfectosV1 ParseEfectosV1(StreamReader sr) { EfectosV1 v = new EfectosV1(); v.nombre = substringindexof(sr.ReadLine()); v.invariante = substringindexof(sr.ReadLine()); v.ebase = substringindexof(sr.ReadLine()); v.textra = substringindexof(sr.ReadLine()); v.efecto1 = substringindexof(sr.ReadLine()); v.tefecto1 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade1 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr1 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.efecto2 = substringindexof(sr.ReadLine()); v.tefecto2 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade2 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr2 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.efecto3 = substringindexof(sr.ReadLine()); v.tefecto3 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade3 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr3 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.efecto4 = substringindexof(sr.ReadLine()); v.tefecto4 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade4 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr4 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.efecto5 = substringindexof(sr.ReadLine()); v.tefecto5 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tade5 = Convert.ToInt32(substringindexof(sr.ReadLine())); v.tatr5 = Convert.ToInt32(substringindexof(sr.ReadLine())); return v; }
private void button3_Click(object sender, EventArgs e) { mW.UndoRedo.AddUndo(mW.script, "Efecto de Karaoke"); EfectosV1 karaoke = new EfectosV1(); karaoke.ebase = EfBase.Text; karaoke.efecto1 = Efecto1.Text; karaoke.efecto2 = Efecto2.Text; karaoke.efecto3 = Efecto3.Text; karaoke.efecto4 = Efecto4.Text; karaoke.efecto5 = Efecto5.Text; karaoke.invariante = Invariante.Text; karaoke.nombre = NombreEfecto.Text; karaoke.tade1 = Convert.ToInt32(Efecto1_TEI.Text); karaoke.tade2 = Convert.ToInt32(Efecto2_TEI.Text); karaoke.tade3 = Convert.ToInt32(Efecto3_TEI.Text); karaoke.tade4 = Convert.ToInt32(Efecto4_TEI.Text); karaoke.tade5 = Convert.ToInt32(Efecto5_TEI.Text); karaoke.tatr1 = Convert.ToInt32(Efecto1_TEF.Text); karaoke.tatr2 = Convert.ToInt32(Efecto2_TEF.Text); karaoke.tatr3 = Convert.ToInt32(Efecto3_TEF.Text); karaoke.tatr4 = Convert.ToInt32(Efecto4_TEF.Text); karaoke.tatr5 = Convert.ToInt32(Efecto5_TEF.Text); karaoke.tefecto1 = Convert.ToInt32(Efecto1_Perc.Text); karaoke.tefecto2 = Convert.ToInt32(Efecto2_Perc.Text); karaoke.tefecto3 = Convert.ToInt32(Efecto3_Perc.Text); karaoke.tefecto4 = Convert.ToInt32(Efecto4_Perc.Text); karaoke.tefecto5 = Convert.ToInt32(Efecto5_Perc.Text); for (int i = 0; i < mW.al.Count; i++) { lineaASS linea = (lineaASS)mW.al[i]; if (GetCheckedState(linea.personaje)) { String TextoLinea = ""; //Creamos Ks int len = LineaASS_to_Karaoke_K(linea, i); //Que gustirrining el copy paste. for (int j = 0; j < len; j++) { //aplicamos TextoLinea += karaoke.AplicaASilaba((Karaoke_K)Ks[j]); } ((lineaASS)mW.al[i]).texto = "{"+karaoke.ebase+"}"+TextoLinea; if (karaoke.tade1 < 0) { ((lineaASS)mW.al[i]).t_inicial.sumaTiempo(Convert.ToDouble(karaoke.tade1)/1000); } if (karaoke.tatr5 > 0) { ((lineaASS)mW.al[i]).t_final.sumaTiempo(Convert.ToDouble(karaoke.tatr5)/1000); } } } mW.updateGridWithArrayList(mW.al); mW.refreshGrid(); }