namespace test { static class Program { public void Main() { time(0, "command1"); time(5000, "command2"); } public void command1(object source, ElapsedEventArgs e) { MessageBox.Show("command1, prepair for 5 second gap!"); } public void command2(object source, ElapsedEventArgs e) { MessageBox.Show("command2, gap complete!"); } public void time(int value, string choice) { System.Timers.Timer t = new System.Timers.Timer(); t.Elapsed += new ElapsedEventHandler(choice); t.Interval = value; t.AutoReset = false; t.Start(); } } }
System.Reflection.ConstructorInfo
System.Object
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)