コード例 #1
0
        internal static void ConsoleLog_JSOnly(string message)
        {
#if BRIDGE
            Interop.ExecuteJavaScript("console.log($0);", message);
#endif
        }
コード例 #2
0
        internal static void SendRequest(object xmlHttpRequest, string address, string method, bool isAsync, string body)
        {
#if BRIDGE
            Interop.ExecuteJavaScript("$0.send($1)", xmlHttpRequest, body);
#endif
        }
コード例 #3
0
        internal static void SetErrorCallback(object xmlHttpRequest, Action <object> OnError)
        {
#if BRIDGE
            Interop.ExecuteJavaScript("$0.onerror = $1", xmlHttpRequest, OnError);
#endif
        }
コード例 #4
0
        private static void EnableCookies(object xmlHttpRequest, bool value)
        {
#if BRIDGE
            Interop.ExecuteJavaScript("$0.withCredentials = $1", xmlHttpRequest, value);
#endif
        }
コード例 #5
0
        private static void CreateRequest(object xmlHttpRequest, string address, string method, bool isAsync)
        {
#if BRIDGE
            Interop.ExecuteJavaScript("$0.open($1, $2, $3)", xmlHttpRequest, method, address, isAsync);
#endif
        }
コード例 #6
0
        [Template("{xmlHttpRequest}.onloadend = {OnDownloadStatusCompleted}")] // Note: we  register to the loadend event instead of the load event because the load event is only fired when the request is SUCCESSFULLY completed, while the loadend is triggered after errors and abortions as well. This allows us to handle the error cases in the callback of asynchronous calls.
#endif

        internal static void SetCallbackMethod(object xmlHttpRequest, Action OnDownloadStatusCompleted)
        {
#if BRIDGE
            Interop.ExecuteJavaScript("$0.onloadend = $1", xmlHttpRequest, OnDownloadStatusCompleted);
#endif
        }
コード例 #7
0
        private static void SetRequestHeader(object xmlHttpRequest, string key, string header)
        {
#if BRIDGE
            Interop.ExecuteJavaScript("$0.setRequestHeader($1, $2)", xmlHttpRequest, key, header);
#endif
        }