private void start() { if (this.txt_minimo.Text.Trim() != String.Empty && this.txt_maximo.Text.Trim() != String.Empty) { try { this.vMin = int.Parse(this.txt_minimo.Text); this.vMax = int.Parse(this.txt_maximo.Text); } catch (System.FormatException sfe) { msg.danger("Formato incorrecto!"); this.txt_minimo.Focus(); return; } if (this.vMin > this.vMax) { msg.danger("Valor menor debe ser menor a mayor y viceversa."); this.txt_minimo.Focus(); return; } } else { msg.danger("Complete valores..."); this.txt_minimo.Focus(); return; } this.c1 = new control(this); this.Hide(); this.c1.Show(); }
public logica(int pMin, int pMax, control ct0) { this.vMin = pMin; this.vMax = pMax; this.t0 = new System.Timers.Timer(globals.speed); this.t0.AutoReset = true; this.t0.Elapsed += (sender, e) => { this.ejecuta(); }; this.ct0 = ct0; this.rGen = new Random(); this.start(); }