示例#1
0
            public object CreateInstance(JsonRpcClient client, IJsonRpcRequestMarshaler marshaler)
            {
                var realProxy = _LastRealProxy;

                if (realProxy == null || realProxy.Client != client ||
                    realProxy.MethodTable != MethodTable || realProxy.Marshaler != marshaler)
                {
                    realProxy = new JsonRpcRealProxy(client, MethodTable, marshaler);
                    Volatile.Write(ref _LastRealProxy, realProxy);
                }
                return(Activator.CreateInstance(ProxyType, realProxy));
            }
示例#2
0
 internal JsonRpcRealProxy(JsonRpcClient client, IList <JsonRpcMethod> methodTable, IJsonRpcRequestMarshaler marshaler)
 {
     this.Client      = client ?? throw new ArgumentNullException(nameof(client));
     this.MethodTable = methodTable ?? throw new ArgumentNullException(nameof(methodTable));
     this.Marshaler   = marshaler ?? throw new ArgumentNullException(nameof(marshaler));
 }