示例#1
0
        /// <summary>Closes the document.</summary>
        public void close()
        {
            if (!IsOpen)
            {
                // Already closed.
                return;
            }

            // Mark as closed:
            IsOpen = false;

            if (!TryCompile())
            {
                // We're downloading code.
                // This flag lets the downloader know it needs to also attempt a TryCompile.
                FinishedParsing = true;
            }

            // Force a render request as required:
            RequestLayout();

            // Setup window:
            window.Ready();

            // Dispatch onload (doesn't bubble):

            if (body != null)
            {
                UIEvent e = new UIEvent("load");
                e.SetTrusted(false);
                body.dispatchEvent(e);
            }
        }
示例#2
0
        /// <summary>Aborts this request.</summary>
        public void abort()
        {
            // trigger an abort event:
            UIEvent e = new UIEvent();

            e.EventType = "abort";
            e.SetTrusted();
            dispatchEvent(e);

            if (abortableObject != null)
            {
                // Aborted it:
                abortableObject.abort();
            }
        }
示例#3
0
        internal override bool ResourceStatus(EventTarget package, int status)
        {
            if (base.ResourceStatus(package, status))
            {
                // Run the onload event if we're in an iframe:
                if (window.iframe != null)
                {
                    // Dispatch to the element too (don't bubble):
                    UIEvent e = new UIEvent("load");
                    e.SetTrusted(false);
                    window.iframe.dispatchEvent(e);
                }

                return(true);
            }

            return(false);
        }