예제 #1
0
        /// <summary>
        /// Adds field interception support intercepting all static fields on the target type.
        /// </summary>
        /// <param name="targetType">The type that will be modified.</param>
        public static void InterceptAllStaticFields(this IReflectionVisitable targetType)
        {
            Func <MethodReference, bool> methodFilter = GetMethodFilter();
            Func <FieldReference, bool>  fieldFilter  = GetFieldFilter(actualField => actualField.IsStatic);

            targetType.InterceptFields(methodFilter, fieldFilter);
        }
        /// <summary>
        /// Adds field interception support intercepting all static fields on the target type.
        /// </summary>
        /// <param name="targetType">The type that will be modified.</param>
        public static void InterceptAllStaticFields(this IReflectionVisitable targetType)
        {
            var methodFilter = GetMethodFilter();
            var fieldFilter  = GetFieldFilter();

            targetType.InterceptFields(methodFilter, fieldFilter);
        }
예제 #3
0
        /// <summary>
        /// Adds field interception support to the target type.
        /// </summary>
        /// <param name="targetType">The type that will be modified.</param>
        public static void InterceptAllFields(this IReflectionVisitable targetType)
        {
            Func <MethodReference, bool> methodFilter = GetMethodFilter();

            targetType.InterceptFields(methodFilter, f => true);
        }