示例#1
0
        private static Control getRegisterControl(RegisterContainerBase cnt, string propertyName)
        {
            foreach (Control c in cnt.Controls)
            {
                switch (c)
                {
                case RegisterValue rv:
                {
                    if (rv.ItemName.Equals(propertyName, StringComparison.Ordinal))
                    {
                        return(rv);
                    }
                    break;
                }

                case RegisterFlag rf:
                {
                    if (rf.ItemName.Equals(propertyName, StringComparison.Ordinal))
                    {
                        return(rf);
                    }
                    break;
                }
                }
            }
            return(null);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        protected void AddControl(RegisterContainerBase control)
        {
            controls.Add(control.RegisterName, control);

            control.Dock = DockStyle.Top;
            flowLayoutPanel1.Controls.Add(control);

            control.ParentEditor = this;

            control.ValueChanged += Control_ValueChanged;
        }