예제 #1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        private void Dispose(bool all)
        {
            try
            {
                if (all)
                {
                    LinkClicked    = null;
                    Refresh        = null;
                    RenderError    = null;
                    StylesheetLoad = null;
                    ImageLoad      = null;
                }

                _cssData = null;
                if (_root != null)
                {
                    _root.Dispose();
                }
                _root = null;
                if (_selectionHandler != null)
                {
                    _selectionHandler.Dispose();
                }
                _selectionHandler = null;
            }
            catch
            {
            }
        }
예제 #2
0
        /// <summary>
        /// Init with optinals document and stylesheet.
        /// </summary>
        /// <param name="htmlSource">the html to init with, init empty if not given</param>
        /// <param name="baseCssData">optional: the stylesheet to init with, init default if not given</param>
        public void SetHtml(string htmlSource, CssData baseCssData = null)
        {
            if (_root != null)
            {
                _root.Dispose();
                _root = null;
                if (_selectionHandler != null)
                {
                    _selectionHandler.Dispose();
                }
                _selectionHandler = null;
            }

            if (!string.IsNullOrEmpty(htmlSource))
            {
                _cssData = baseCssData ?? CssUtils.DefaultCssData;

                _root = DomParser.GenerateCssTree(htmlSource, this, ref _cssData);
                if (_root != null)
                {
                    _root.HtmlContainer = this;
                    _selectionHandler   = new SelectionHandler(_root);
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Clear the content of the HTML container releasing any resources used to render previously existing content.
        /// </summary>
        public void Clear()
        {
            _hoverBoxes?.Clear(); //Au: bug fix: Added ?. The demo app crashed at startup.

            if (_root != null)
            {
                _root.Dispose();
                _root = null;
                if (_selectionHandler != null)
                {
                    _selectionHandler.Dispose();
                }
                _selectionHandler = null;
            }
        }
        /// <summary>
        /// Clear the content of the HTML container releasing any resources used to render previously existing content.
        /// </summary>
        public void Clear()
        {
            _hoverBoxes.Clear();

            if (_root != null)
            {
                _root.Dispose();
                _root = null;
                if (_selectionHandler != null)
                {
                    _selectionHandler.Dispose();
                }
                _selectionHandler = null;
            }
        }
예제 #5
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;
            }
        }
예제 #6
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 (_resourceServer != null)
                {
                    _resourceServer.Dispose();
                }
                _resourceServer = null;

                _hoverBoxes = null;
            }
        }