Torna al Thread

class Temporizzatori { static System.Windows.Forms.Timer myTimer = new System.Windows.Forms.Timer(); public void GestioneTemporizzatori(string RigaDaGestire, char risultato, byte[] AppoggioTemporizzatori, string[] Temporizzatori) { int Tempo = int.Parse((RigaDaGestire.Substring(59, 5))); if (risultato == '1') { AppoggioTemporizzatori[int.Parse(RigaDaGestire.Substring(48, 3))] = 1; } else { AppoggioTemporizzatori[int.Parse(RigaDaGestire.Substring(48, 3))] = 0; } if (AppoggioTemporizzatori[int.Parse(RigaDaGestire.Substring(48, 3))] == 1) { myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = Tempo; myTimer.Start(); } else { myTimer.Stop(); } } private static void TimerEventProcessor(Object myObject, EventArgs myEventArgs) { myTimer.Stop(); //// Comando da eseguire allo scadere del timer ////MessageBox.Show("Fine conteggio"); Temporizzatori[int.Parse(RigaDaGestire.Substring(48, 3))] = "1"; //// Restart Timer //// myTimer.Enabled = true; } }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5