/// <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 { } }
/// <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); } } }
/// <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; } }
/// <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; } }
/// <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; } }