private static IRes FindResInArray(List <IRes> list, ResSearchRule resSearchRule) { if (list == null) { return(null); } for (var i = list.Count - 1; i >= 0; --i) { if (resSearchRule.Match(list[i])) { return(list[i]); } } return(null); }