private void JobDestinationDlg_Deactivate(object sender, System.EventArgs e) { lock (locker) { udp.Close(); udp = null; } }
private void JobDestinationDlg_Activated(object sender, System.EventArgs e) { //timer.Change(polling ? 3000 : 0,30000); udp = new udp(); timer.Change(0, 0); // One time and only one time. Runs in a different thread. //TimerTick(this); //Console.WriteLine("poll"); //if (!polling) TimerTick(this); // One time. }