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); }
/// <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; }