Converted source files to UTF-8 (without byte order mark). Use UTF-8 as the default...
[mono.git] / mcs / class / corlib / System.Collections / Queue.cs
index bf0348aadad727e974f1a583636ae08349010a35..ae99d9aa6d5cd900683cd8da178049bdb6cbb508 100644 (file)
@@ -2,9 +2,9 @@
 // System.Collections.Queue
 //
 // Author:
-//    Ricardo Fernández Pascual
+//    Ricardo Fernández Pascual
 //
-// (C) 2001 Ricardo Fernández Pascual
+// (C) 2001 Ricardo Fernández Pascual
 //
 
 //
 
 using System;
 using System.Collections;
+using System.Runtime.InteropServices;
 
 namespace System.Collections {
 
+#if NET_2_0
+       [ComVisible(true)]
+#endif
        [Serializable]
        public class Queue : ICollection, IEnumerable, ICloneable {
 
@@ -52,9 +56,11 @@ namespace System.Collections {
                        if (col == null)
                                throw new ArgumentNullException ("col");
                        
-                       _size = _array.Length;
-                       _tail = _size;
-                       col.CopyTo (_array, 0);
+                       // We have to do this because msft seems to call the
+                       // enumerator rather than CopyTo. This affects classes
+                       // like bitarray.
+                       foreach (object o in col)
+                               Enqueue (o);    
                }
                        
                public Queue (int initialCapacity, float growFactor) {