/// <summary>
        /// Initializes a new instance of the <see cref="JsonRpcTargetOptions"/> class.
        /// </summary>
        /// <param name="copyFrom">An instance to copy all property values from.</param>
        public JsonRpcTargetOptions(JsonRpcTargetOptions copyFrom)
        {
            Requires.NotNull(copyFrom, nameof(copyFrom));

            this.MethodNameTransform      = copyFrom.MethodNameTransform;
            this.EventNameTransform       = copyFrom.EventNameTransform;
            this.NotifyClientOfEvents     = copyFrom.NotifyClientOfEvents;
            this.AllowNonPublicInvocation = copyFrom.AllowNonPublicInvocation;
            this.UseSingleObjectParameterDeserialization = copyFrom.UseSingleObjectParameterDeserialization;
            this.DisposeOnDisconnect = copyFrom.DisposeOnDisconnect;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RpcMarshaledContext{T}"/> class.
        /// </summary>
        /// <param name="value">The value that should be used in the object graph to be sent over RPC, to trigger marshaling.</param>
        /// <param name="options">The <see cref="JsonRpcTargetOptions"/> to use when adding this object as an RPC target.</param>
        internal RpcMarshaledContext(T value, JsonRpcTargetOptions options)
        {
            if (value is IJsonRpcClientProxy)
            {
                // Supporting passing of a marshaled object over RPC requires that we:
                // 1. Distinguish passing it back to its original owner vs. a 3rd party over an independent RPC connection.
                // 2. If back to the original owner, we need to reuse the same handle and pass other data so the receiver recognizes this case.
                throw new NotSupportedException("Marshaling a proxy back to its owner ");
            }

            this.Proxy = value;
            this.JsonRpcTargetOptions = options;
        }