public TProxy GetClient <TProxy>(IWampConnection <TMessage> connection) where TProxy : class { IWampRpcClientHandler handler = mClientHandlerBuilder.Build(connection); WampRpcClientSyncInterceptor syncInterceptor = new WampRpcClientSyncInterceptor(mSerializer, handler); WampRpcClientAsyncInterceptor asyncInterceptor = new WampRpcClientAsyncInterceptor(mSerializer, handler); TProxy result = DispatchProxy.Create <TProxy, RpcDispatchProxy>(); RpcDispatchProxy dispatchProxy = result as RpcDispatchProxy; dispatchProxy.SyncInterceptor = syncInterceptor; dispatchProxy.AsyncInterceptor = asyncInterceptor; return(result); }
public TProxy GetClient <TProxy>(IWampConnection <TMessage> connection) where TProxy : class { IWampRpcClientHandler handler = mClientHandlerBuilder.Build(connection); WampRpcClientSyncInterceptor syncInterceptor = new WampRpcClientSyncInterceptor(mSerializer, handler); WampRpcClientAsyncInterceptor asyncInterceptor = new WampRpcClientAsyncInterceptor(mSerializer, handler); ProxyGenerationOptions generationOptions = new ProxyGenerationOptions { Selector = new WampRpcClientInterceptorSelector() }; TProxy result = mProxyGenerator.CreateInterfaceProxyWithoutTarget <TProxy> (generationOptions, syncInterceptor, asyncInterceptor); return(result); }