+2008-07-15 Jonathan Pobst <monkey@jpobst.com>
+
+ * ImageList.cs: Fix ICollection.CopyTo implementation for
+ ImageListCollection. [Fixes bug #409169]
+
2008-07-14 Jonathan Pobst <monkey@jpobst.com>
* MenuAPI.cs, ToolStripDropDown.cs: Use VirtualScreen instead of
void ICollection.CopyTo(Array dest, int index)
{
- for (int imageIndex = 0; imageIndex < this.Count; imageIndex++)
- dest.SetValue (this [index], index++);
+ list.CopyTo (dest, index);
}
#endregion // ImageCollection Interface Methods
}
using System.ComponentModel;
using NUnit.Framework;
using System.Threading;
+using System.Collections;
namespace MonoTests.System.Windows.Forms
myimagelist.ToString (), "#T3");
}
+ [Test]
+ public void Bug409169 ()
+ {
+ ImageList imgList = new ImageList ();
+ ImageList.ImageCollection coll = imgList.Images;
+ Bitmap img1 = new Bitmap (10, 10);
+ coll.Add (img1);
+
+ const int dstOffset = 5;
+ object[] dst = new object[dstOffset + coll.Count];
+ ((IList)coll).CopyTo (dst, dstOffset);
+
+ Assert.IsNotNull (dst[dstOffset], "A1");
+ }
+
[TestFixture]
public class ImageListRecreateHandleEventClass
{