internal void OnUnsuccessfulCalibration(CalibrationContext context, PlateCalibration plateCalibration) { m_PlateToReport = null; try { string tempFilename = Path.GetTempFileName(); plateCalibration.SaveContext(tempFilename); string zippedFileName = Path.GetFullPath(tempFilename + ".zip"); ZipUnzip.Zip(tempFilename, zippedFileName); m_PlateToReport = File.ReadAllBytes(zippedFileName); File.Delete(tempFilename); File.Delete(zippedFileName); } catch (Exception ex) { Trace.WriteLine(ex); } if (m_PlateToReport != null) { double mbSize = m_PlateToReport.Length * 1.0 / (1024 * 1024); btnSendProblemFit.Text = string.Format("Report Unsolved Plate ({0} Mb)", mbSize.ToString("0.00")); btnSendProblemFit.Visible = true; } }