private bool DoesNotHaveNoPoliciesAttributeRule(MethodImplementationInfo method) { bool doesNotHaveRule = true; doesNotHaveRule &= method.InterfaceMethodInfo != null?doesNotHaveNoPoliciesAttributeRule.Matches(method.InterfaceMethodInfo) : true; doesNotHaveRule &= doesNotHaveNoPoliciesAttributeRule.Matches(method.ImplementationMethodInfo); return(doesNotHaveRule); }
/// <summary> /// Checks to see if this policy contains rules that match members /// of the given type. /// </summary> /// <param name="t">Type to check.</param> /// <returns>true if any of the members of type t match the ruleset for this policy, false if not.</returns> public bool AppliesTo(Type t) { if (Array.Exists(t.GetMethods(), delegate(MethodInfo method) { return(doesNotHaveNoPoliciesAttributeRule.Matches(method)); })) { return(DoesApplyTo(t)); } return(false); }