/// <summary> /// 生成一个控件,会根据MultiSelect属性来决定生成CheckBox还是RadioButton /// </summary> public Control CreateSubControl(SelectGroupItem selectGroupItem) { Control control = null; if (MultiSelect) { control = new CheckBox(); } else { control = new RadioButton(); } control.Text = selectGroupItem.Text; this.Controls.Add(control); return(control); }
public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } SelectGroupItem compareItem = (SelectGroupItem)obj; if (!object.Equals(Value, compareItem.Value)) { return(false); } if (!object.Equals(Text, compareItem.Text)) { return(false); } return(true); }