// Load and Construct private void loadButton_Click(object sender, EventArgs e) { foreach (string configpath in ConfigurePathList) { TimerForm f = new TimerForm(configpath); f.Show(); } }
// Receive the event when start a timer in the TimerChooseForm UI logic. private void ChosenReceiver(object sender, TimerChooseForm.ChosenEventArgs e) { Console.WriteLine("Just Selected and started the timer."); Action DoAction = delegate() { TimerForm f = new TimerForm(e.duration, e.option, e.cycle_limit); f.Show(); this.TCF.Close(); }; if (this.InvokeRequired) { ControlExtensions.UIThreadInvoke(this, delegate { DoAction(); }); } else { DoAction(); } }