Udostępnij za pośrednictwem


ServiceJsonRpcDescriptor.ConstructLocalProxy<T>(T) Method

Definition

Wraps some target object with a proxy that gives the caller the similar semantics to calling an actual RPC object using JsonRpc.

public:
generic <typename T>
 where T : class override T ConstructLocalProxy(T target);
public override T? ConstructLocalProxy<T> (T? target) where T : class;
override this.ConstructLocalProxy : 'T -> 'T (requires 'T : null)
Public Overrides Function ConstructLocalProxy(Of T As Class) (target As T) As T

Type Parameters

T

The interface that the returned proxy must implement.

Parameters

target
T

The object to which all calls to the proxy should be forwarded.

Returns

T

The proxy, or null if target is null.

Remarks

The proxy will forward all calls made to the T interface to the target object. Exceptions thrown from the target will be caught by the proxy and a RemoteInvocationException will be thrown instead with some of the original exception details preserved (but not as an InnerException) in order to emulate what an RPC connection would be like. This proxy implements T. The proxy also implements IDisposable and will forward a call to Dispose() to the target object if the target object implements IDisposable.

Applies to