In the example code, they are passing a single file but in your case, you are passing an array of files. To process a batch of files, you will need to use an iterator such as a FOR or a FOREACH loop:
Here is an example:
http://www.harrisgeospati...ing-an-ENVITask.aspx