2007-01-28 Marek Sieradzki <marek.sieradzki@gmail.com>
[mono.git] / mcs / class / Microsoft.Build.Engine / Microsoft.Build.BuildEngine / BuildPropertyGroupCollection.cs
index 6c3c3987e0463427acec71948c2a465940a9cfe2..a240107addd3f2ac379849be1084f3272a685268 100644 (file)
@@ -31,16 +31,16 @@ using System;
 using System.Collections;
 
 namespace Microsoft.Build.BuildEngine {
-       public class BuildPropertyGroupCollection : IBuildPropertyGroupCollection, ICollection, IEnumerable {
+       public class BuildPropertyGroupCollection : ICollection, IEnumerable {
 
                GroupingCollection      groupingCollection;
        
-               public BuildPropertyGroupCollection ()
+               BuildPropertyGroupCollection ()
                {
-                       groupingCollection = new GroupingCollection ();
+                       groupingCollection = new GroupingCollection (null);
                }
 
-               public BuildPropertyGroupCollection (GroupingCollection groupingCollection)
+               internal BuildPropertyGroupCollection (GroupingCollection groupingCollection)
                {
                        this.groupingCollection = groupingCollection;
                }
@@ -50,39 +50,18 @@ namespace Microsoft.Build.BuildEngine {
                        if (array == null)
                                throw new ArgumentNullException ("array");
                        if (index < 0)
-                               throw new ArgumentOutOfRangeException ("index");
+                               throw new IndexOutOfRangeException ("Index was outside the bounds of the array.");
                        if (array.Rank > 1)
                                throw new ArgumentException ("array is multidimensional");
                        if ((array.Length > 0) && (index >= array.Length))
-                               throw new ArgumentException ("index is equal or greater than array.Length");
+                               throw new IndexOutOfRangeException ("Index was outside the bounds of the array.");
                        if (index + this.Count > array.Length)
-                               throw new ArgumentException ("Not enough room from index to end of array for this BuildPropertyGroupCollection");
+                               throw new IndexOutOfRangeException ("Index was outside the bounds of the array.");
                
                        IEnumerator it = GetEnumerator ();
                        int i = index;
                        while (it.MoveNext ()) {
-                               array.SetValue(it.Current, i++);
-                       }
-               }
-
-               public void CopyToStronglyTypedArray (BuildPropertyGroup[] array,
-                                                     int index)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (index < 0)
-                               throw new ArgumentOutOfRangeException ("index");
-                       if (array.Rank > 1)
-                               throw new ArgumentException ("array is multidimensional");
-                       if ((array.Length > 0) && (index >= array.Length))
-                               throw new ArgumentException ("index is equal or greater than array.Length");
-                       if (index + this.Count > array.Length)
-                               throw new ArgumentException ("Not enough room from index to end of array for this BuildPropertyGroupCollection");
-               
-                       IEnumerator it = GetEnumerator ();
-                       int i = index;
-                       while (it.MoveNext ()) {
-                               array.SetValue((BuildPropertyGroup) it.Current, i++);
+                               array.SetValue (it.Current, i++);
                        }
                }
 
@@ -117,4 +96,4 @@ namespace Microsoft.Build.BuildEngine {
        }
 }
 
-#endif
\ No newline at end of file
+#endif