Example #1
0
        public Proxy <T> OnBefore(Action <IMethodInvocation> action)
        {
            Require.ArgumentNotNull("action", action);
            var callback = new OnBeforeCallback(action);

            interceptedMembers.ForEach(e => register[e].Add(callback));
            return(this);
        }
Example #2
0
        /// <summary>
        /// Called when before.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">The <paramref name="action"/> is <c>null</c>.</exception>
        public ICallbackHandler <TService, TServiceImplementation> OnBefore(Action <IInvocation> action)
        {
            Argument.IsNotNull("action", action);

            var callback = new OnBeforeCallback(action);

            AddCallBack(callback);
            return(this);
        }