Table of Contents

Class JsonRpcProxyOptions

Namespace
StreamJsonRpc
Assembly
StreamJsonRpc.dll

Options that may customize how a generated client proxy object calls into a JsonRpc instance.

public class JsonRpcProxyOptions
Inheritance
JsonRpcProxyOptions
Inherited Members

Constructors

JsonRpcProxyOptions()

Initializes a new instance of the JsonRpcProxyOptions class.

public JsonRpcProxyOptions()

JsonRpcProxyOptions(JsonRpcProxyOptions)

Initializes a new instance of the JsonRpcProxyOptions class with properties initialized from another instance.

public JsonRpcProxyOptions(JsonRpcProxyOptions copyFrom)

Parameters

copyFrom JsonRpcProxyOptions

The options to copy values from.

Properties

AcceptProxyWithExtraInterfaces

Gets or sets a value indicating whether source generated proxies that implement a proper superset of the client's requested interfaces may be returned.

public bool AcceptProxyWithExtraInterfaces { get; set; }

Property Value

bool

The default value is false.

Remarks

Does not apply when ProxySource is set to AlwaysDynamic.

Code that uses the proxy and wants to do feature testing should use Is(Type) or As<T>(IClientProxy?) instead of conditional casts to avoid false positives when this property is true.

Default

Gets an instance with default properties.

public static JsonRpcProxyOptions Default { get; }

Property Value

JsonRpcProxyOptions

Remarks

Callers should not mutate properties on this instance since it is shared.

EventNameTransform

Gets or sets a function that takes the CLR event name and returns the RPC event name used in notifications. This method is useful for adding prefixes to all events, or making them camelCased.

public Func<string, string> EventNameTransform { get; set; }

Property Value

Func<string, string>

A function, defaulting to a straight pass-through. Never null.

Exceptions

ArgumentNullException

Thrown if set to a null value.

MethodNameTransform

Gets or sets a function that takes the CLR method name and returns the RPC method name. This method is useful for adding prefixes to all methods, or making them camelCased.

public Func<string, string> MethodNameTransform { get; set; }

Property Value

Func<string, string>

A function, defaulting to a straight pass-through. Never null.

Exceptions

ArgumentNullException

Thrown if set to a null value.

ProxySource

Gets or sets the implementation of the proxy to use when generating a client proxy.

public JsonRpcProxyOptions.ProxyImplementation ProxySource { get; set; }

Property Value

JsonRpcProxyOptions.ProxyImplementation

The default value is PreferSourceGenerated.

ServerRequiresNamedArguments

Gets or sets a value indicating whether the client proxy will pass named arguments (i.e. an args object) instead of the default positional arguments (i.e. an args array).

public bool ServerRequiresNamedArguments { get; set; }

Property Value

bool