private void FinalDeSalida(int bomberoIndex) { if (this.fuegos[bomberoIndex].InvokeRequired) { FinDeSalida finDeSalida = new FinDeSalida(FinalDeSalida); this.BeginInvoke(finDeSalida, new object[] { bomberoIndex }); } else { this.fuegos[bomberoIndex].Visible = false; } }
/// <summary> /// Creates and Invokes a delegate. /// </summary> /// <param name="bomberoIndex">Index of the firefighter in to finish the service.</param> private void InvokeDelegate(int bomberoIndex) { FinDeSalida fSalida = new FinDeSalida(this.FinalDeSalida); this.Invoke(fSalida, new object[] { bomberoIndex }); }