/***************************************************************/ public void AddDiagnostic(Diagnostic d) { Items.Add(d); DiagnosticSummaryResultView dsrv = new DiagnosticSummaryResultView(d); flowLayoutPanel1.Controls.Add(dsrv); }
/***************************************************************/ private void DiagnosticSummaryResultView_DateChaged(object sender, EventArgs e) { Items.Sort(Diagnostic.CompareDiagnosticByDate); foreach (Control c in flowLayoutPanel1.Controls) { DiagnosticSummaryResultView dsrv = (DiagnosticSummaryResultView)c; flowLayoutPanel1.Controls.SetChildIndex(c, Items.IndexOf(dsrv.GetDiagnostic())); } }
/***************************************************************/ public void RemoveDiagnostic(Diagnostic theStudy) { Control doomed = null; foreach (Control c in flowLayoutPanel1.Controls) { if (c is DiagnosticSummaryResultView) { DiagnosticSummaryResultView dsrv = (DiagnosticSummaryResultView)c; if (dsrv.GetDiagnostic() == theStudy) { doomed = dsrv; } } } if (doomed != null) { flowLayoutPanel1.Controls.Remove(doomed); } }