示例#1
0
        public void Open(string uri, string method, Action readyStateChangeCallback)
        {
            Util.CheckArgumentNull(uri, "uri");
            Util.CheckArgumentNull(method, "method");
            Util.CheckArgumentNull(readyStateChangeCallback, "readyStateChangeCallback");

            ScriptObject callback = ScriptObjectUtility.ToScriptFunction(readyStateChangeCallback);

            ScriptObjectUtility.CallOpen(this.request, method, uri);
            ScriptObjectUtility.SetReadyStateChange(this.request, callback);
        }
示例#2
0
        public void Dispose()
        {
            var currentRequest = this.request;

            if (currentRequest != null)
            {
                try
                {
                    ScriptObjectUtility.SetReadyStateChange(currentRequest, null);
                }
                finally
                {
                    this.request = null;
                }
            }
        }