public bool RemoveChartPoints(string projName) { IProjectChartPoints pcp = GetProjectChartPoints(projName); if (pcp != null) { IFileChartPoints fCPs = null; while ((fCPs = pcp.filePoints.FirstOrDefault()) != null) { if (fCPs.linePoints.Count == 0) { pcp.filePoints.Remove(fCPs); } else { ILineChartPoints lCPs = null; while ((lCPs = fCPs.linePoints.FirstOrDefault()) != null) { if (lCPs.chartPoints.Count == 0) { fCPs.RemoveLineChartPoints(lCPs); } else { IChartPoint cp = null; while ((cp = lCPs.chartPoints.FirstOrDefault()) != null) { lCPs.RemoveChartPoint(cp); } } } } } data.projPoints.Remove(pcp); } return(true); }