protected override void Dispose(bool disposing) { // call the base impl first to avoid conflicts with any parent's events base.Dispose(disposing); if (disposing) { // Mop up the mess; or should we wait for the GC to kick in? timer.Stop(); timer.Dispose(); // Not sure if we should clean up tooltip_window tooltip_window.Dispose(); tooltip_strings.Clear(); #if NET_2_0 //UIA Framework: ToolTip isn't associated anymore foreach (Control control in controls) { OnUIAToolTipUnhookUp(this, new ControlEventArgs(control)); } #endif controls.Clear(); } }
/// <summary> /// Hides the current <see cref="InteractiveToolTip"/>. /// </summary> /// <remarks> /// <para> /// If the <see cref="InteractiveToolTip"/> is not visible, the method just returns. /// </para> /// </remarks> public void Hide() { _durationTimer.Stop(); ToolTipWindow toolTip = _currentToolTip; IWin32Window window; if (null != toolTip) { _currentToolTip = null; window = toolTip.Window; toolTip.Dispose(); if (null != ToolTipHidden) { ToolTipHidden(this, new InteractiveToolTipEventArgs(window)); } } }