/// <summary> /// Unsubscribe from events and dispose of <see cref="HtmlContainer"/>. /// </summary> protected virtual void OnToolTipDisposed(EventArgs e) { Popup -= OnToolTipPopup; Draw -= OnToolTipDraw; Disposed -= OnToolTipDisposed; if (HtmlContainer != null) { HtmlContainer.RenderError -= OnRenderError; HtmlContainer.StylesheetLoad -= OnStylesheetLoad; HtmlContainer.ImageLoad -= OnImageLoad; HtmlContainer.Dispose(); HtmlContainer = null; } #if !MONO if (_linkHandlingTimer != null) { _linkHandlingTimer.Dispose(); _linkHandlingTimer = null; if (HtmlContainer != null) { HtmlContainer.LinkClicked -= OnLinkClicked; } } #endif }
/// <summary> /// Release the html container resources. /// </summary> protected override void Dispose(bool disposing) { if (_htmlContainer != null) { _htmlContainer.LinkClicked -= OnLinkClicked; _htmlContainer.RenderError -= OnRenderError; _htmlContainer.Refresh -= OnRefresh; _htmlContainer.StylesheetLoad -= OnStylesheetLoad; _htmlContainer.ImageLoad -= OnImageLoad; _htmlContainer.Dispose(); _htmlContainer = null; } base.Dispose(disposing); }