title: C# Timer With Lambda Instead of Method Reference?
body: <p>Let's say I have the following code:    </p>
  
  <pre><code>var secondsElapsed = 0;
  
  Timer myTimer = new Timer();
  myTimer.Elapsed += new ElapsedEventHandler( iterateSecondsElapsed);
  myTimer.Interval = 1000;
  myTimer.Start();
  
  
  //Somewhere else in the code:
  public static void iterateSecondsElapsed( object source, ElapsedEventArgs e )
  {
      secondsElapsed++; 
  }
  </code></pre>
  
  <p>Is there any way to do this WITHOUT defining the DisplayTimEvent static method? Something like:</p>
  
  <pre><code>myTimer.Elapsed += new ElapsedEventHandler( secondsElapsed =&gt; secondsElapsed ++);
  </code></pre>
  
  <p>I realize I am showing a profound lack of understanding of lambdas here, but nonetheless...</p>