Skylar,
Just for the sake of argument, every screen requires a timer with same interval, but each screen has a different task. And, I declare a delegate:
Code:
public delegate void TimerHandle();
That Timer would run through the process. Therefore, I create TimerProcess script module:
Code:
public partial class TimerProcess
{
private static Timer timer;
private static int temp;
static TimerProcess()
{
timer = new Timer();
timer.Interval = 500;
timer.Tick += new EventHandler(TimerProcessHandler);
}
public void Start()
{
timer.Enabled = true;
}
public void Stop()
{
timer.Enabled = false;
}
public void Method1()
{
//task for Screen1 in here
}
private static void TimerProcessHandler(Object send, EventArgs e)
{
//handle each screen task in here
}
}
This would point to any method/function by every Screen Opened event:
Code:
void Screen1(System.Object sender, System.EventArgs e)
{
TimerHandle = Globals.TimerProcess.Method1();
}
That’s what I thought currently. Is it possible to do it?