private int AddTableRow(FeaturedTableLayoutPanel ftlp, float height)
        {
            int      index    = ftlp.tlp_TableLayoutPanel.RowCount++;
            RowStyle rowStyle = new RowStyle(SizeType.Absolute, height);

            ftlp.tlp_TableLayoutPanel.RowStyles.Add(rowStyle);
            ftlp.tlp_TableLayoutPanel.Height += (int)height;
            return(index);
        }
        private void AddRow(FeaturedTableLayoutPanel ftlp, Control label, Control value)
        {
            int rowIndex = AddTableRow(ftlp, 20F);

            ftlp.tlp_TableLayoutPanel.Controls.Add(label, 0, rowIndex);
            if (value != null)
            {
                ftlp.tlp_TableLayoutPanel.Controls.Add(value, 1, rowIndex);
            }
        }
        public void InitFeaturedTableLayoutPanelForTelemetry(Telemetry telemetry, EventHandler validatedEventHandler)
        {
            List <Type> types = Utils.Utils.GetAllNestedTypes(typeof(Telemetry));

            foreach (Type t in types)
            {
                if (t.GetNestedTypes(BindingFlags.Public).Length > 0)
                {
                    FeaturedFlowLayoutPanel fFlp = new FeaturedFlowLayoutPanel();
                    fFlp.lbl_Title.Text = t.Name;
                    fFlp.Name           = "fFlp_" + t.Name;
                    if (t.ReflectedType == typeof(Telemetry))
                    {
                        flp_FlowLayoutPanel.Controls.Add(fFlp);
                    }
                    else
                    {
                        FeaturedFlowLayoutPanel parentFflp = (FeaturedFlowLayoutPanel)Utils.Utils.GetControlByName(flp_FlowLayoutPanel, "fFlp_" + t.ReflectedType.Name);
                        parentFflp.flp_Fflp.Controls.Add(fFlp);
                    }
                }
                else // if (t.IsNested && Utils.Utils.GetPropertyInfos(t, null).Keys.Count = 0)
                {
                    FeaturedTableLayoutPanel fTlp = new FeaturedTableLayoutPanel();
                    fTlp.lbl_Title.Text = t.Name;
                    fTlp.Name           = "fTlp_" + t.Name;
                    if (t.ReflectedType == typeof(Telemetry))
                    {
                        flp_FlowLayoutPanel.Controls.Add(fTlp);
                    }
                    else
                    {
                        FeaturedFlowLayoutPanel parentFflp = (FeaturedFlowLayoutPanel)Utils.Utils.GetControlByName(flp_FlowLayoutPanel, "fFlp_" + t.ReflectedType.Name);
                        parentFflp.flp_Fflp.Controls.Add(fTlp);
                    }
                }
            }

            foreach (Type t in types)
            {
                if (t.GetNestedTypes().Length == 0)
                {
                    Dictionary <PropertyInfo, object> pis = Utils.Utils.GetPropertyInfos(t, null);
                    foreach (PropertyInfo pi in pis.Keys)
                    {
                        ModelTypeDef             mtd              = new ModelTypeDef(pi);
                        Label                    label            = CreateLabel(pi.Name);
                        Control                  dedicatedControl = CreateDedicatedControl(mtd, null, validatedEventHandler);
                        FeaturedTableLayoutPanel parentFtp        = (FeaturedTableLayoutPanel)Utils.Utils.GetControlByName(flp_FlowLayoutPanel, "fTlp_" + pi.ReflectedType.Name);
                        AddRow(parentFtp, label, dedicatedControl);
                        AddTableRow(parentFtp, 10F);
                    }
                }
            }
        }