예제 #1
0
파일: ToolTip.cs 프로젝트: raj581/Marvin
        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();
            }
        }
예제 #2
0
        /// <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));
                }
            }
        }