title: How to pass parameters to the function called by ElapsedEventHandler?
body: <p>How to pass parameters to the function called by ElapsedEventHandler?</p>
  
  <p>My code:</p>
  
  <pre><code>private static void InitTimer(int Index)
  {
      keepAlive[Index] = new Timer();
      keepAlive[Index].Interval = 3000;
      keepAlive[Index].Elapsed += new ElapsedEventHandler(keepAlive_Elapsed[, Index]);
      keepAlive[Index].Start();
  }
  
  public static void keepAlive_Elapsed(object sender, EventArgs e[, int Index])
  {
  
      PacketWriter writer = new PacketWriter();
      writer.AppendString("KEEPALIVE|.\\");
      ServerSocket.Send(writer.getWorkspace(), Index);
      ServerSocket.DisconnectSocket(Index);
  }
  </code></pre>
  
  <p>What I want to do is between the brackets ([ and ]).
  But just doing it like that obviously doesn't work...</p>