private MessageBridgeResponse OnSetObjectProperty(MessageBridgeRequest request)
        {
            if (request.Name == SET_OBJECT_PROPERTY)
            {
                var objectKey = request.Arguments[0].GetString();

                var propertyName = request.Arguments[1].GetString();

                var retval = JavaScriptValue.FromJson(request.Arguments[2].GetString());


                if (RegisteredJavaScriptObjects.ContainsKey(objectKey))
                {
                    var targetObject = RegisteredJavaScriptObjects[objectKey];

                    if (targetObject != null && targetObject.HasValue(propertyName))
                    {
                        var value = targetObject.GetValue(propertyName);

                        if (value.IsProperty)
                        {
                            value.Property?.Setter?.Invoke(retval);

                            return(MessageBridgeResponse.CreateSuccessResponse());
                        }
                    }
                }

                return(MessageBridgeResponse.CreateFailureResponse("Setter is not defined."));
            }

            return(null);
        }
        private MessageBridgeResponse OnExecuteFunction(MessageBridgeRequest request)
        {
            if (request.Name == EXECUTE_JAVASCRIPT_FUNCTION)
            {
                var objectKey    = request.Arguments[0].GetString();
                var propertyName = request.Arguments[1].GetString();

                var arguments = JavaScriptValue.FromJson(request.Arguments[2].GetString()).ToArray();


                if (RegisteredJavaScriptObjects.ContainsKey(objectKey))
                {
                    var targetObject = RegisteredJavaScriptObjects[objectKey];

                    if (targetObject != null && targetObject.HasValue(propertyName))
                    {
                        var value = targetObject.GetValue(propertyName);

                        if (value.IsFunction)
                        {
                            var functionInfo = value.JSFunctionDescriber;

                            if (functionInfo != null)
                            {
                                if (functionInfo.IsAsync)
                                {
                                    var uuid  = new Guid(request.Arguments[3].GetString());
                                    var frame = BrowserSideBridge.Owner.GetMainFrame();
                                    value.AsyncMethod?.Invoke(arguments, new JavaScriptAsyncFunctionCallback(frame, /* objectKey, propertyName,*/ uuid, this));

                                    var response = MessageBridgeResponse.CreateSuccessResponse();

                                    return(response);
                                }
                                else
                                {
                                    var retval   = value.Method?.Invoke(arguments) ?? JavaScriptValue.CreateNull();
                                    var response = MessageBridgeResponse.CreateSuccessResponse();

                                    response.Arguments.Add(MessageValue.CreateString(retval.ToDefinition()));

                                    return(response);
                                }
                            }
                        }
                    }
                }
            }

            //return MessageBridgeResponse.CreateFailureResponse("Function is not defined.");

            return(null);
        }