private bool IsConditionAvailable(ConditionType[] Types) { foreach (var button in Panel_SelectedSkillDetails.Controls.OfType<Button>().Where(x => x.Name != "SkillIcon")) { ConditionType _Type = (ConditionType)Enum.Parse(typeof(ConditionType), button.Text.Split(' ').Last()); if (Types.Contains(_Type)) return true; } return false; }