コード例 #1
0
        private void AddClinicalObservation(ClincalObservation co)
        {
            var add = ClinicalObservationDoesNotExist(co);

            if (add)
            {
                if (string.IsNullOrEmpty(co.disease) == false)
                {
                    PedigreeLegendRow plr = new PedigreeLegendRow();
                    plr.SetObservation(co);
                    flowLayoutPanel.Controls.Add(plr);
                    this.Visible = true;
                }
            }
        }
コード例 #2
0
ファイル: PedigreeLegend.cs プロジェクト: mahitosh/HRA4
        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();
                            }
                        }
                    }
                }
            }
        }
コード例 #3
0
ファイル: PedigreeLegend.cs プロジェクト: mahitosh/HRA4
        public void AddSingleObservation(ClincalObservation dx, bool isNew)
        {
            if (flowLayoutPanel.InvokeRequired)
            {
                AddSingleObservationCallback aoc = new AddSingleObservationCallback(AddSingleObservation);
                object[] args = new object[1];
                args[0] = dx;
                args[1] = isNew;
                this.Invoke(aoc, args);
            }
            else
            {
                bool add = true;
                foreach (Control c in flowLayoutPanel.Controls)
                {
                    PedigreeLegendRow plr            = (PedigreeLegendRow)c;
                    string            plrDisplayName = plr.GetObservationisplayName();
                    string            plrShortName   = plr.GetObservationisplayShortName();
                    if (string.Compare(dx.ClinicalObservation_diseaseDisplayName, plrDisplayName, true) == 0 &&
                        string.Compare(dx.ClinicalObservation_diseaseShortName, plrShortName) == 0)
                    {
                        add = false;
                    }
                }
                if (add)
                {
                    if (string.IsNullOrEmpty(dx.disease) == false)
                    {
                        PedigreeLegendRow plr = new PedigreeLegendRow();
                        plr.SetObservation(dx);

                        flowLayoutPanel.Controls.Add(plr);

                        this.Height = flowLayoutPanel.Location.Y + plr.Location.Y + plr.Height + legendPadding;
                        if (isNew)
                        {
                            if (flowLayoutPanel.Controls.Count == 1)
                            {
                                this.Location = new Point(SessionManager.Instance.MetaData.CurrentUserDefaultPedigreePrefs.GUIPreference_LegendX,
                                                          SessionManager.Instance.MetaData.CurrentUserDefaultPedigreePrefs.GUIPreference_LegendY);
                            }
                            int maxWidth = 0;
                            foreach (Control c in flowLayoutPanel.Controls)
                            {
                                PedigreeLegendRow row = (PedigreeLegendRow)c;
                                if (row.Width > maxWidth)
                                {
                                    maxWidth = row.Width;
                                }
                            }
                            if (maxWidth + legendPadding > this.Width)
                            {
                                this.Width = maxWidth + legendPadding;
                            }
                        }
                        this.Refresh();
                    }
                }
                CheckForEmpty();
            }
        }
コード例 #4
0
ファイル: PedigreeLegend.cs プロジェクト: mahitosh/HRA4
 private void AddClinicalObservation(ClincalObservation co)
 {
     var add = ClinicalObservationDoesNotExist(co);
     if (add)
     {
         if (string.IsNullOrEmpty(co.disease) == false)
         {
             PedigreeLegendRow plr = new PedigreeLegendRow();
             plr.SetObservation(co);
             flowLayoutPanel.Controls.Add(plr);
             this.Visible = true;
         }
     }
 }
コード例 #5
0
ファイル: PedigreeLegend.cs プロジェクト: mahitosh/HRA4
        public void AddSingleObservation(ClincalObservation dx, bool isNew)
        {
            if (flowLayoutPanel.InvokeRequired)
            {
                AddSingleObservationCallback aoc = new AddSingleObservationCallback(AddSingleObservation);
                object[] args = new object[1];
                args[0] = dx;
                args[1] = isNew;
                this.Invoke(aoc, args);
            }
            else
            {
                bool add = true;
                foreach (Control c in flowLayoutPanel.Controls)
                {
                    PedigreeLegendRow plr = (PedigreeLegendRow)c;
                    string plrDisplayName = plr.GetObservationisplayName();
                    string plrShortName = plr.GetObservationisplayShortName();
                    if (string.Compare(dx.ClinicalObservation_diseaseDisplayName, plrDisplayName, true) == 0 &&
                        string.Compare(dx.ClinicalObservation_diseaseShortName, plrShortName) == 0)
                    {
                        add = false;
                    }
                }
                if (add)
                {
                    if (string.IsNullOrEmpty(dx.disease) == false)
                    {
                        PedigreeLegendRow plr = new PedigreeLegendRow();
                        plr.SetObservation(dx);

                        flowLayoutPanel.Controls.Add(plr);

                        this.Height = flowLayoutPanel.Location.Y + plr.Location.Y + plr.Height + legendPadding;
                        if (isNew)
                        {
                            if (flowLayoutPanel.Controls.Count == 1)
                            {
                                this.Location = new Point(SessionManager.Instance.MetaData.CurrentUserDefaultPedigreePrefs.GUIPreference_LegendX,
                                                          SessionManager.Instance.MetaData.CurrentUserDefaultPedigreePrefs.GUIPreference_LegendY);
                            }
                            int maxWidth = 0;
                            foreach (Control c in flowLayoutPanel.Controls)
                            {
                                PedigreeLegendRow row = (PedigreeLegendRow)c;
                                if (row.Width > maxWidth)
                                    maxWidth = row.Width;
                            }
                            if (maxWidth + legendPadding > this.Width)
                                this.Width = maxWidth + legendPadding;
                        }
                        this.Refresh();
                    }
                }
                CheckForEmpty();
            }
        }
コード例 #6
0
ファイル: PedigreeLegend.cs プロジェクト: mahitosh/HRA4
        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();
                            }
                        }
                    }
                }
            }
        }