private void onCheckedChanged(object sender, EventArgs e) { foreach (object o in Enum.GetValues(typeof(ECondType))) { ECondType eType = (ECondType)o; if (((RadioButton)sender).Text.Contains(" " + Enum.GetName(typeof(ECondType), eType) + " ")) { selected = eType; break; } } }
internal void setType(ECondType e) { foreach (RadioButton rb in rbs) { if (!rb.Text.Contains(" " + Enum.GetName(typeof(ECondType), e) + " ")) { continue; } rb.Checked = true; selected = e; return; } }