title: "new System.Timers.ElapsedEventHandler(DoStuff)" call did not work
body: <p>I'am trying to create watch folder aplicaction in C# that will do an action when new file will arrive. Since the watched folder is on GPFS share I'am unable to use FileSystemWatcher (which works fine for me in NTFS). So I've based the app on other collegue <a href="https://stackoverflow.com//questions/3612311/monitoring-a-folder-for-new-file-creation-without-using-filesystemwatcher-in-ne">solution</a>.
  The app shows nicely "Timer starts" message but when it comes to</p>
  
  <pre><code>timer.Elapsed += new System.Timers.ElapsedEventHandler(DoStuff);
  </code></pre>
  
  <p>it did not calls the DoStuff method - "Starting new files proc" message never show up. What I've done wrong? Here is complete code:</p>
  
  <pre><code>namespace MonitorFolderActivity
  {
      public partial class frmMain : Form
      {
          List&lt;string&gt; fileList = new List&lt;string&gt;();
          System.Timers.Timer timer;
          DateTime LastChecked;
  
          public frmMain()
          {
              InitializeComponent();
          }
          private void abortAcitivityMonitoring()
          {
              btnStart_Stop.Text = "Start";
              txtActivity.Focus();
          }
  
          private void startActivityMonitoring(string sPath)
          {
              if (sPath.Length &lt; 3)
              {
                  MessageBox.Show("You have to enter a folder to monitor.",
                      "Hey..!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
  
                  abortAcitivityMonitoring();
              }
              else
              {
                  TS_AddLogText(string.Format("Timer starts\r\n"));
                  timer = new System.Timers.Timer();
                  timer.AutoReset = false;
  
                  timer.Elapsed += new System.Timers.ElapsedEventHandler(DoStuff);
              }
          }
  
          private void stopActivityMonitoring()
          {
              TS_AddLogText(string.Format("Timer stops\r\n"));
              this.timer.Stop();
          }
  
          private void DoStuff(object sender, System.Timers.ElapsedEventArgs e)
          {
              TS_AddLogText(string.Format("Starting new files proc\r\n"));
              LastChecked = DateTime.Now;
  
              string[] files = System.IO.Directory.GetFiles("D:\\MEDIAIN\\", "*", System.IO.SearchOption.AllDirectories);
  
              foreach (string file in files)
              {
                  if (!fileList.Contains(file))
                  {
                      fileList.Add(file);
                      TS_AddLogText(string.Format(file));
                  }
              }
  
  
              TimeSpan ts = DateTime.Now.Subtract(LastChecked);
              TimeSpan MaxWaitTime = TimeSpan.FromMinutes(1);
  
              if (MaxWaitTime.Subtract(ts).CompareTo(TimeSpan.Zero) &gt; -1)
                  timer.Interval = MaxWaitTime.Subtract(ts).TotalMilliseconds;
              else
                  timer.Interval = 1;
  
              timer.Start();
          }
  
          private delegate void AddLogText(string text);
          private void TS_AddLogText(string text)
          {
              if (this.InvokeRequired)
              {
                  AddLogText del = new AddLogText(TS_AddLogText);
                  Invoke(del, text);
              }
              else
              {
                  txtActivity.Text += text;
              }
          }
  
          private void btnStart_Stop_Click(object sender, EventArgs e)
          {
              if (btnStart_Stop.Text.Equals("Start"))
              {
                  btnStart_Stop.Text = "Stop";
                  startActivityMonitoring(txtFolderPath.Text);
              }
              else
              {
                  btnStart_Stop.Text = "Start";
                  stopActivityMonitoring();
              }
          }
  
          private void lblActivity_Click(object sender, EventArgs e)
          {
  
          }
  
          private void lblToMonitor_Click(object sender, EventArgs e)
          {
  
          }
      }
  }
  </code></pre>