Terminate() public méthode

Terminate whole key tip's adorner chain
public Terminate ( ) : void
Résultat void
Exemple #1
0
 // Window's messages hook up
 IntPtr WindowProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
 {
     // Mouse clicks in non client area
     if ((msg >= 161) && (msg <= 173))
     {
         if ((activeAdornerChain != null) && (activeAdornerChain.IsAdornerChainAlive))
         {
             activeAdornerChain.Terminate();
             activeAdornerChain = null;
         }
     }
     return(IntPtr.Zero);
 }
Exemple #2
0
        // Window's messages hook up
        IntPtr WindowProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            // We must terminate the keytip's adorner chain if:
            // - mouse clicks in non client area
            // - the window is deactivated
            if (((msg >= 161) && (msg <= 173)) || msg == NativeMethods.WM_NCACTIVATE)
            {
                if ((activeAdornerChain != null) && (activeAdornerChain.IsAdornerChainAlive))
                {
                    activeAdornerChain.Terminate();
                    activeAdornerChain = null;
                }
            }

            return(IntPtr.Zero);
        }
        /// <summary>
        /// Terminate whole key tip's adorner chain
        /// </summary>
        public void Terminate()
        {
            if (terminated)
            {
                return;
            }

            terminated = true;

            Detach();
            if (parentAdorner != null)
            {
                parentAdorner.Terminate();
            }
            if (childAdorner != null)
            {
                childAdorner.Terminate();
            }
            if (Terminated != null)
            {
                Terminated(this, EventArgs.Empty);
            }

            Log("Termination");
        }