I'm following this tutorial to write a Windows Service.
Every 60 seconds, a new event is raised that writes to the event log.
In the code, the new event is raised using the +=
operator.
// Set up a timer that triggers every minute.
Timer timer = new Timer();
timer.Interval = 60000; // 60 seconds
timer.Elapsed += new ElapsedEventHandler(this.OnTimer);
timer.Start();
Whats the motivation for using this operator here? Why is it not just =
? Especially the +
part seems to confuse me..