public Polygon GetPolygon (BoundingBoxAttachment attachment) { int index = BoundingBoxes.IndexOf(attachment); return index == -1 ? null : Polygons.Items[index]; } }