コード例 #1
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('/', '+');
            var visibilityScope = ((MethodAttributes)method.Attributes).ToVisibilityScope() | ((TypeAttributes)method.DeclaringType.Attributes).ToVisibilityScope();
            var memberKind      = method.GetMemberKind();

            return(pointcutSelector.Select(name, visibilityScope, memberKind));
        }