private bool IsMatch(ICriteria criteria) { for (int i = 0; i < _stackTrace.FrameCount; i++) { MethodBase method = _stackTrace.GetFrame(i).GetMethod(); if (criteria.IsSatisfied(method)) { return(true); } } return(false); }
/// <summary> /// Returns true if the supplied <see cref="System.Reflection.MemberInfo"/> instance /// satisfies the supplied <paramref name="filterCriteria"/> (which must be an /// <see cref="Oragon.Spring.Core.ICriteria"/> implementation). /// </summary> /// <param name="member"> /// The <see cref="System.Reflection.MemberInfo"/> instance that will be checked to see if /// it matches the supplied <paramref name="filterCriteria"/>. /// </param> /// <param name="filterCriteria"> /// The criteria against which to filter the supplied /// <see cref="System.Reflection.MemberInfo"/> instance. /// </param> /// <returns> /// True if the supplied <see cref="System.Reflection.MemberInfo"/> instance /// satisfies the supplied <paramref name="filterCriteria"/> (which must be an /// <see cref="Oragon.Spring.Core.ICriteria"/> implementation); false if not or the /// supplied <paramref name="filterCriteria"/> is not an /// <see cref="Oragon.Spring.Core.ICriteria"/> implementation or is null. /// </returns> public virtual bool FilterMemberByCriteria(MemberInfo member, object filterCriteria) { ICriteria criteria = filterCriteria as ICriteria; return(criteria.IsSatisfied(member)); }
private bool IsMatch(ICriteria criteria) { for (int i = 0; i < _stackTrace.FrameCount; i++) { MethodBase method = _stackTrace.GetFrame(i).GetMethod(); if(criteria.IsSatisfied(method)) { return true; } } return false; }