private static void DoSomething(Object state) { if (isRunning) { Console.WriteLine("DoSomething still running from last time {0}", DateTime.Now.ToString("dd/MMM/yy HH:mm:ss")); return; } isRunning = true; var helper = new DRHelper(); helper.DoSomething(); isRunning = false; }
private void btnTestEMail_Click(object sender, EventArgs e) { DRHelper helper = new DRHelper(); helper.TestEMail(); }
private void btnHarvestTrainJourneyInfo_Click(object sender, EventArgs e) { DRHelper helper = new DRHelper(); helper.DoSomething(chkConnected.Checked); MessageBox.Show("All Done"); }