I have a Windows service written in C# which is meant to perform a task every few minutes. I\'m using a System.Timers.Timer for this but it doesn\'t ever appea
I also had to switch to System.Threading.Timer. To make re-factoring easier and others live easy, I created a separate class, containing an instance of System.Threading.Timer and has almost the same methods as System.Timers.Timer, so that calling code requires minimal changes:
///
/// Custom Timer class, that is actually a wrapper over System.Threading.Timer
///
///
internal class Timer : IDisposable
{
System.Threading.Timer _timer;
public Timer()
{
}
public Timer(int interval) : this()
{
this.Interval = interval;
}
public bool AutoReset { get; set; }
public bool Enabled { get; set; }
public int Interval { get; set; }
public Action
I hope this will help!