コード例 #1
0
ファイル: GeneticTestingView.cs プロジェクト: mahitosh/HRA4
        public void FillControls()
        {
            if (loadingCircle1.InvokeRequired)
            {
                fillControlsCallback fcc = new fillControlsCallback(FillControls);
                this.Invoke(fcc, null);
            }
            else
            {
                loadingCircle1.Active  = false;
                loadingCircle1.Visible = false;

                relativeHeader1.setRelative(selectedRelative);

                flowLayoutPanel1.Controls.Clear();

                foreach (GeneticTest geneticTest in pmh.GeneticTests)
                {
                    GeneticTestingRowExpandable newRow = new GeneticTestingRowExpandable(this, geneticTest);
                    flowLayoutPanel1.Controls.Add(newRow);
                    //Application.DoEvents();
                }
                setupPanels();

                if (pmh.GeneticTests.Count == 0)
                {
                    noLabel.Visible = true;
                }
                else
                {
                    noLabel.Visible = false;
                }
            }
        }
コード例 #2
0
        private void RemoveFromUI(Control control)
        {
            Control flowLayoutPanel = this.Parent;

            flowLayoutPanel.Controls.Remove(control);

            GeneticTestingRowExpandable expander = (GeneticTestingRowExpandable)flowLayoutPanel.Parent;

            expander.DoScroll(GeneticTestingRowExpandable.ScrollEnum.Shrink);
            expander.DoScroll(GeneticTestingRowExpandable.ScrollEnum.Grow);
        }
コード例 #3
0
ファイル: GeneticTestingView.cs プロジェクト: mahitosh/HRA4
        /**************************************************************************************************/

        private void GeneticTestListChanged(HraListChangedEventArgs e)
        {
            if (e.hraOperand != null)
            {
                GeneticTest geneticTest = (GeneticTest)e.hraOperand;

                switch (e.hraListChangeType)
                {
                case HraListChangedEventArgs.HraListChangeType.ADD:

                    GeneticTestingRowExpandable newRow = new GeneticTestingRowExpandable(this, geneticTest);
                    flowLayoutPanel1.Controls.Add(newRow);

                    //setup grouping
                    int    selectedGroupID = 1;
                    String groupName       = testGroupComboBox.Text;
                    if (!String.IsNullOrEmpty(groupName))
                    {
                        selectedGroupID = this.testList
                                          .Where(t => ((GeneticTestObject)t).groupingName.Equals(groupName))
                                          .Select(t => ((GeneticTestObject)t).groupingID)
                                          .Distinct()
                                          .SingleOrDefault();
                    }
                    newRow.setGroupID(selectedGroupID);
                    break;

                case HraListChangedEventArgs.HraListChangeType.DELETE:
                    Control doomed = null;
                    foreach (Control c in flowLayoutPanel1.Controls)
                    {
                        GeneticTestingRowExpandable targetRow = (GeneticTestingRowExpandable)c;
                        if (targetRow.GetGeneticTest() == geneticTest)
                        {
                            doomed = c;
                        }
                    }
                    if (doomed != null)
                    {
                        flowLayoutPanel1.Controls.Remove(doomed);
                    }

                    if (pmh.GeneticTests.Count == 0)
                    {
                        noLabel.Visible = true;
                    }

                    break;
                }
            }
        }
コード例 #4
0
ファイル: GeneticTestingView.cs プロジェクト: mahitosh/HRA4
        public void FillControls()
        {
            if (loadingCircle1.InvokeRequired)
            {
                fillControlsCallback fcc = new fillControlsCallback(FillControls);
                this.Invoke(fcc, null);
            }
            else
            {
                loadingCircle1.Active = false;
                loadingCircle1.Visible = false;

                relativeHeader1.setRelative(selectedRelative);

                flowLayoutPanel1.Controls.Clear();

                foreach (GeneticTest geneticTest in pmh.GeneticTests)
                {
                    GeneticTestingRowExpandable newRow = new GeneticTestingRowExpandable(this, geneticTest);
                    flowLayoutPanel1.Controls.Add(newRow);
                    //Application.DoEvents();
                }
                setupPanels();

                if (pmh.GeneticTests.Count == 0)
                    noLabel.Visible = true;
                else
                    noLabel.Visible = false;
            }
        }
コード例 #5
0
ファイル: GeneticTestingView.cs プロジェクト: mahitosh/HRA4
        /**************************************************************************************************/
        private void GeneticTestListChanged(HraListChangedEventArgs e)
        {
            if (e.hraOperand != null)
            {
                GeneticTest geneticTest = (GeneticTest)e.hraOperand;

                switch (e.hraListChangeType)
                {
                    case HraListChangedEventArgs.HraListChangeType.ADD:

                        GeneticTestingRowExpandable newRow = new GeneticTestingRowExpandable(this, geneticTest);
                        flowLayoutPanel1.Controls.Add(newRow);

                        //setup grouping
                        int selectedGroupID = 1;
                        String groupName = testGroupComboBox.Text;
                        if (!String.IsNullOrEmpty(groupName))
                        {
                            selectedGroupID = this.testList
                                    .Where(t => ((GeneticTestObject)t).groupingName.Equals(groupName))
                                    .Select(t => ((GeneticTestObject)t).groupingID)
                                    .Distinct()
                                    .SingleOrDefault();
                        }
                        newRow.setGroupID(selectedGroupID);
                        break;
                    case HraListChangedEventArgs.HraListChangeType.DELETE:
                        Control doomed = null;
                        foreach (Control c in flowLayoutPanel1.Controls)
                        {
                            GeneticTestingRowExpandable targetRow = (GeneticTestingRowExpandable)c;
                            if (targetRow.GetGeneticTest() == geneticTest)
                                doomed = c;
                        }
                        if (doomed != null)
                            flowLayoutPanel1.Controls.Remove(doomed);

                        if (pmh.GeneticTests.Count == 0)
                            noLabel.Visible = true;

                        break;
                }
            }
        }