Exemplo n.º 1
0
        private bool DoesNotHaveNoPoliciesAttributeRule(MethodImplementationInfo method)
        {
            bool doesNotHaveRule = true;

            doesNotHaveRule &= method.InterfaceMethodInfo != null?doesNotHaveNoPoliciesAttributeRule.Matches(method.InterfaceMethodInfo) : true;

            doesNotHaveRule &= doesNotHaveNoPoliciesAttributeRule.Matches(method.ImplementationMethodInfo);
            return(doesNotHaveRule);
        }
Exemplo n.º 2
0
 /// <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);
 }