Esempio n. 1
0
        public object Intercept(InvocationInfo info)
        {
            object result = null;

            _wrapper.BeforeInvoke(info);
            result = _wrapper.DoInvoke(info);
            _wrapper.AfterInvoke(info, result);

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        ///     Intercepts a method call and passes the <see cref="IInvocationInfo" /> arguments
        ///     down to the <see cref="IInvokeWrapper" /> instance.
        /// </summary>
        /// <param name="info">The <see cref="IInvocationInfo" /> instance that describes the method currently being executed.</param>
        /// <returns>The return value of the target method.</returns>
        public object Intercept(IInvocationInfo info)
        {
            object result = null;

            // Signal the beginning of the method call
            _wrapper.BeforeInvoke(info);

            // Process the method call itself
            result = _wrapper.DoInvoke(info);

            // Postprocess the results
            _wrapper.AfterInvoke(info, result);

            return(result);
        }