コード例 #1
0
        public override IMessage Invoke(IMessage msg)
        {
            var methodCall = msg as IMethodCallMessage;
            var methodInfo = methodCall.MethodBase as MethodInfo;

            methodInterceptor = methodInfo.GetCustomAttribute <IMethodInterceptor>();
            PreCall(msg);
            var returnValue = methodInfo.Invoke(baseObject, methodCall.Args);

            PostCall(msg, returnValue);
            return(new ReturnMessage(baseObject, methodCall.Args, methodCall.ArgCount, methodCall.LogicalCallContext, methodCall));
        }
コード例 #2
0
 public RealProxyImpl(T obj) : base(typeof(T))
 {
     baseObject = obj;
     methodInterceptorOnClass = obj.GetType().GetCustomAttribute <IMethodInterceptor>();
 }