title: Unable to pass custom method to ElapsedEventHandler() as an argument
body: <p>I am working on a windows service which will look for backup files in a particular folder. When it finds one the service will move all the backup files from that location and move them to an archived folder.</p>
  <p>I have used <code>FileSystemWatcher</code> before but since it doesn't work on Servers I am using <code>DirectoryInfo</code> to look for the files.</p>
  <p>The requirement is to run this service at every 5 minutes interval to look for any new backup files coming in.</p>
  <p>I am stuck with the timer implementation.</p>
  <h2>Following is my code:</h2>
  <p>I want to call <code>MoveToProcessed(processed)</code> method from the ElapsedEventHandler. but I am getting error <strong>CS0149 - Method name expected</strong>.</p>
  <pre><code>protected override void OnStart(string[] args)
  {
      DirectoryInfo dir = new DirectoryInfo(backupdirectory);
  
      // Other unrelated code omitted
  
      // Move all the Backup files to Processed folder at certain intervals.
      createOrderTimer = new System.Timers.Timer();
  
      //***** ERROR ON THE FOLLOWING LINE *****
      createOrderTimer.Elapsed += new ElapsedEventHandler(MoveToProcessed(processed));
      //***************************************
  
      createOrderTimer.Interval = 300000; // 15 min
      createOrderTimer.Enabled = true;
      createOrderTimer.AutoReset = true;
      createOrderTimer.Start();
  }
  
  private void MoveToProcessed(string processed)
  {
      // Code here backs up and restores files
  }
  </code></pre>