Exemplo n.º 1
0
 void _SetVisible(bool show, TBHide reason)
 {
     //AOutput.Write(show, reason);
     if (show)
     {
         if (_hide == 0)
         {
             return;
         }
         _hide &= ~reason;
         if (_hide != 0)
         {
             return;
         }
     }
     else
     {
         var h = _hide;
         _hide |= reason;
         if (h != 0)
         {
             return;
         }
     }
     _SetVisibleLL(show);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Adds or removes a reason to temporarily hide the toolbar. The toolbar is hidden if at least one reason exists. See also <seealso cref="Close"/>.
 /// </summary>
 /// <param name="hide">true to hide (add <i>reason</i>), false to show (remove <i>reason</i>).</param>
 /// <param name="reason">An user-defined reason to hide/unhide. Can be <see cref="TBHide.User"/> or a bigger value, eg (TBHide)0x20000, (TBHide)0x40000.</param>
 /// <exception cref="InvalidOperationException">
 /// - The toolbar was never shown (<see cref="Show"/> not called).
 /// - It is a satellite toolbar.
 /// </exception>
 /// <exception cref="ArgumentOutOfRangeException"><i>reason</i> is less than <see cref="TBHide.User"/>.</exception>
 /// <remarks>
 /// Toolbars are automatically hidden when the owner window is hidden, minimized, etc. This function can be used to hide toolbars for other reasons.
 /// </remarks>
 public void Hide(bool hide, TBHide reason)
 {
     if (!_loaded || _satPlanet != null)
     {
         throw new InvalidOperationException();
     }
     if (0 != ((int)reason & 0xffff))
     {
         throw new ArgumentOutOfRangeException();
     }
     _SetVisible(!hide, reason);
 }