public static bool Polygon2DContainsObject(Polygon2D containerPolygon, Geometry2D contentObject) { bool containsAll = false; Vector2D[] objectsVertices = contentObject.GetVertices(); if (!contentObject.Equals(containerPolygon)) { for (int i = 0; i < objectsVertices.Length; i++) { if (PointIsInsidePolygon(containerPolygon, objectsVertices[i])) { containsAll = true; } else { containsAll = false; break; } } } return(containsAll); }