public static QueryServiceField FromValue(string value) { foreach (QueryServiceField queryServiceField in QueryServiceField.Values()) { if (queryServiceField.Value().Equals(value)) { return(queryServiceField); } } throw new ArgumentException(value.ToString()); }
public static List <QueryServiceField> Values() { QueryServiceField queryServiceField = new QueryServiceField(); List <QueryServiceField> queryServiceFieldList = new List <QueryServiceField>(); foreach (FieldInfo field in queryServiceField.GetType().GetFields()) { queryServiceFieldList.Add((QueryServiceField)field.GetValue((object)queryServiceField)); } return(queryServiceFieldList); }