For example, as System.Threadingwell as System.Timersa class Timer. Therefore, if I would like to use System.Timers.Timerin a class that uses System.Threading, I need to use things like
System.Timers.Timer myTimer = new System.Timers.Timer();
every time I want to declare / initialize timers. Is there a way to tell the compiler that "when I say Timeruse System.Timers.Timerunless otherwise stated?" So i can use simple
Timer t = new Timer();
in cases by default means System.Timers.Timerunless I specify explicitly
System.Threading.Timer t2 = new System.Threading.Timer();
source
share