Exception in MapLabelLayer

Feb 1, 2012 at 2:25 AM

hi all

Is there someone meet the same exception with me

the exception occur in the code below:

private static bool Collides(RectangleF rectangle, IEnumerable drawnRectangles)
        {
            foreach (RectangleF drawnRectangle in drawnRectangles)
            {
                if (rectangle.IntersectsWith(drawnRectangle)) return true;
            }
            return false;
        }
It shows that collection has changed, can't work with foreach loop!
Developer
Feb 1, 2012 at 4:10 PM

I didn't immediately find the IntersectsWith method that you are referencing. The two closest matches are

C:\dev\DotSpatial\DotSpatial.Data\RectangleExt.cs(39):        public static bool IntersectsWith(this Rectangle self, RectangleF other)  C:\dev\DotSpatial\DotSpatial.Symbology\SymbologyRectangleExt.cs(39):        public static bool IntersectsWith(this Rectangle self, RectangleF other)

Both of these (which are duplicates) expect that the first object is a Rectangle, while yours is a RectangleF.

Feb 2, 2012 at 12:42 AM

mudnug, thanks for answering me ,the method you reference is not the one I metion, the method is private static bool Collides(RectangleF rectangle, IEnumerable drawnRectangles) in the file MapLabelLayer.cs, Thanks all the same!