示例#1
0
        /// <summary>
        /// Gets whether the invocation represents a property access, either get or set.
        /// </summary>
        public static bool IsPropertyAccessor(this IMethodInvocation invocation)
        {
            var parameterCount = invocation.MethodBase.GetParameters().Length;

            return((invocation.IsGetAccessor() && parameterCount == 0) ||
                   (invocation.IsSetAccessor() && parameterCount == 1));
        }