New test.
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / FindUnderPath.cs
index f626ab5dc2c96fbd01fbc786532aec92c50e1530..2d1de22c2532f1fb6cfeb645b363dff45ba4f6f6 100644 (file)
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
+#if NET_2_0
+
 using System;
-using System.Collections;
+using System.Collections.Generic;
 using System.IO;
 using Microsoft.Build.Framework;
 
@@ -44,8 +46,8 @@ namespace Microsoft.Build.Tasks {
 
                public override bool Execute ()
                {
-                       ArrayList temporaryInPath = new ArrayList ();
-                       ArrayList temporaryOutOfPath = new ArrayList ();
+                       List <ITaskItem> temporaryInPath = new List <ITaskItem> ();
+                       List <ITaskItem> temporaryOutOfPath = new List <ITaskItem> ();
                        
                        if (path == null) {
                                Log.LogError (null, null, null, BuildEngine.ProjectFileOfTaskNode,
@@ -80,15 +82,9 @@ namespace Microsoft.Build.Tasks {
                                }
                        }
                        
-                       inPath = new ITaskItem [temporaryInPath.Count];
-                       int i = 0;
-                       foreach (ITaskItem file in temporaryInPath)
-                               inPath [i++] = file;
-                       outOfPath = new ITaskItem [temporaryOutOfPath.Count];
-                       i = 0;
-                       foreach (ITaskItem file in temporaryOutOfPath)
-                               outOfPath [i++] = file;
-                       
+                       inPath = temporaryInPath.ToArray ();
+                       outOfPath = temporaryOutOfPath.ToArray ();
+
                        return true;
                }
 
@@ -132,3 +128,5 @@ namespace Microsoft.Build.Tasks {
                }
        }
 }
+
+#endif
\ No newline at end of file