コード例 #1
0
        void downloader_DownloadDataCompleted(object sender, System.IO.Stream ImageStream)
        {
            if (InvokeRequired)
            {
                //Cross-thread error prevention
                Invoke(new EventHandler <System.IO.Stream>(downloader_DownloadDataCompleted), sender, ImageStream);
            }
            else
            {
                if (_progress != null)
                {
                    _progress.Visible = false;
                    _progress.Dispose();
                    this.Controls.Clear();

                    if (ImageStream == null)
                    {
                        _screenshot = null;
                    }
                    else
                    {
                        _screenshot = Image.FromStream(ImageStream);
                    }

                    RenderScreenshot();
                }

                downloader.Dispose();
                _thread = null;
            }
        }
コード例 #2
0
        /// <summary>
        /// Clear the content of the HTML container releasing any resources used to render previously existing content.
        /// </summary>
        public void Clear()
        {
            if (_root != null)
            {
                _root.Dispose();
                _root = null;

                if (_selectionHandler != null)
                {
                    _selectionHandler.Dispose();
                }
                _selectionHandler = null;

                if (_imageDownloader != null)
                {
                    _imageDownloader.Dispose();
                }
                _imageDownloader = null;

                _hoverBoxes = null;
            }
        }