/// <summary> /// Return the first item in ET that has the attribute A and evalFunc return true. /// </summary> /// <param name="evalFunc"></param> /// <returns></returns> public static ET ParseByEval(Func <A, bool> evalFunc) { foreach (var enumValue in Enum.GetValues(typeof(ET))) { if (evalFunc(AttributeUtils <A> .FindAttribute(enumValue))) { return((ET)enumValue); } } return(default(ET)); }
/// <summary> /// Find the specific attribute from object. /// </summary> /// <param name="obj"></param> /// <returns></returns> public static A FindAttribute(object obj) { return(AttributeUtils <A> .FindAttribute(obj)); }