public void AddObservations(ClinicalObservationList dxList) { if (flowLayoutPanel.InvokeRequired) { AddObservationsCallback aoc = new AddObservationsCallback(AddObservations); object[] args = new object[1]; args[0] = dxList; this.Invoke(aoc, args); } else { lock (dxList) { foreach (ClincalObservation co in dxList) { bool add = true; foreach (Control c in flowLayoutPanel.Controls) { PedigreeLegendRow plr = (PedigreeLegendRow)c; string plrDisplayName = plr.GetObservationisplayName(); string plrShortName = plr.GetObservationisplayShortName(); if (string.Compare(co.ClinicalObservation_diseaseDisplayName, plrDisplayName, true) == 0 && string.Compare(co.ClinicalObservation_diseaseShortName, plrShortName) == 0) { add = false; break; } } if (add) { if (string.IsNullOrEmpty(co.disease) == false) { PedigreeLegendRow plr = new PedigreeLegendRow(); plr.SetObservation(co); flowLayoutPanel.Controls.Add(plr); this.Height = flowLayoutPanel.Location.Y + plr.Location.Y + plr.Height + legendPadding; this.Refresh(); } } } } } }
public void AddObservations(ClinicalObservationList dxList) { if (flowLayoutPanel.InvokeRequired) { AddObservationsCallback aoc = AddObservations; object[] args = new object[1]; args[0] = dxList; this.Invoke(aoc, args); } else { lock (dxList) { foreach (ClincalObservation co in dxList) { AddClinicalObservation(co); } CheckForEmpty(); } CalculateOptimalDimensions(); } }