/// <summary>
        /// Indicates whether the specified node has to be selected for advice
        /// </summary>
        /// <param name="pointcutSelector">The pointcut selector.</param>
        /// <param name="method">The method.</param>
        /// <returns></returns>
        public static bool Select(this PointcutSelector pointcutSelector, MethodDef method)
        {
            var name            = $"{method.DeclaringType.FullName}.{method.Name}".Replace('/', '+');
            var visibilityScope = ((MethodAttributes)method.Attributes).ToVisibilityScope() | ((TypeAttributes)method.DeclaringType.Attributes).ToVisibilityScope();
            var memberKind      = method.GetMemberKind();

            return(pointcutSelector.Select(name, visibilityScope, memberKind));
        }
示例#2
0
 private static bool SelectAdvice(AdviceInfo adviceInfo, PointcutSelector rules)
 {
     return(rules.Select(adviceInfo.Advice.GetType().FullName, null, null));
 }
        public static bool Select(this PointcutSelector pointcutSelector, ITypeDefOrRef type)
        {
            var name = type.FullName.Replace('/', '+');

            return(pointcutSelector.Select(name, null, null));
        }
示例#4
0
        /// <summary>
        /// Indicates whether the specified node has to be selected for advice
        /// </summary>
        /// <param name="pointcutSelector">The pointcut selector.</param>
        /// <param name="method">The method.</param>
        /// <returns></returns>
        public static bool Select(this PointcutSelector pointcutSelector, MethodDef method)
        {
            var name = $"{method.DeclaringType.FullName}.{method.Name}".Replace('/', '+');

            return(pointcutSelector.Select(name, ((MethodAttributes)method.Attributes).ToMemberAttributes() | ((TypeAttributes)method.DeclaringType.Attributes).ToMemberAttributes()));
        }