////[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] public static BoundingBoxXYZ SectionViewExtentsBoundingBox(UIView view) { if (view == null) { return(new BoundingBoxXYZ()); } BoundingBoxXYZ result = new BoundingBoxXYZ(); try { XYZ min = new XYZ(view.GetZoomCorners()[0].X, view.GetZoomCorners()[0].Y, view.GetZoomCorners()[0].Z - 4); XYZ max = new XYZ(view.GetZoomCorners()[1].X, view.GetZoomCorners()[1].Y, view.GetZoomCorners()[1].Z + 4); result.set_Bounds(0, min); result.set_Bounds(1, max); } catch (ArgumentException ex) { System.Diagnostics.Debug.WriteLine(ex.Message); result.Dispose(); return(null); } return(result); }