/// <summary> /// Close out all bounding box items here. /// </summary> public void CloseAllBoxes() { // Close the box here and remove from list of items. foreach (var BoundingBox in BoundingBoxList) { BoundingBox.Close(); } // Clear the list. BoundingBoxList = new List <BoundingBoxDisplayHelper>(); }
/// <summary> /// Closes all bounding box forms which contain the given color object for the background. /// </summary> /// <param name="BrushColor"></param> public void CloseBoundingBox(int PaneNumber) { // Get all the boxes to close out. var BoxesToClose = BoundingBoxList.Where(BoxObj => BoxObj.PaneNumber == PaneNumber).ToList(); if (BoxesToClose.Count == 0) { return; } // Close the box here and remove from list of items. foreach (var BoundingBox in BoxesToClose) { // Remove from list. int IndexOfBox = BoundingBoxList.IndexOf(BoundingBox); BoundingBoxList.RemoveAt(IndexOfBox); // Close box. BoundingBox.Close(); } }