Ejemplo n.º 1
0
        internal override bool IsMatching(MethodDefinition methodDefinition)
        {
            if (base.IsMatching(methodDefinition))
            {
                var declaringType         = methodDefinition.DeclaringType;
                var typeVisibility        = VisibilityHelper.GetTypeVisibilityLevel(declaringType);
                var methodVisibilityLevel = VisibilityHelper.GetMethodVisibilityLevel(methodDefinition);

                //check type visibility
                if ((int)typeVisibility > (int)_targetClass)
                {
                    return(false);
                }

                //then method visibility will decide
                return((int)methodVisibilityLevel <= (int)_targetMethod);
            }
            return(false);
        }