Example #1
0
        /// <summary>
        /// Unregisters the specified <see cref="HamburgerTitleBar"/> control.
        /// </summary>
        /// <param name="hamburgerTitleBar">The <see cref="HamburgerTitleBar"/> control.</param>
        internal void UnregisterHamburgerTitleBar(HamburgerTitleBar hamburgerTitleBar)
        {
            lock (_registeredControlsLock)
            {
                if (_registeredHamburgerTitleBar != hamburgerTitleBar)
                {
                    throw new ArgumentException("The registered HamburgerTitleBar control is not the same as the one indicated.", nameof(hamburgerTitleBar));
                }

                hamburgerTitleBar.MenuButtonClick -= HamburgerTitleBar_MenuButtonClick;

                _registeredHamburgerTitleBar = null;
            }
        }
Example #2
0
        /// <summary>
        /// Registers the specified <see cref="HamburgerTitleBar"/> control.
        /// </summary>
        /// <param name="hamburgerTitleBar">The <see cref="HamburgerTitleBar"/> control.</param>
        internal void RegisterHamburgerTitleBar(HamburgerTitleBar hamburgerTitleBar)
        {
            lock (_registeredControlsLock)
            {
                if (_registeredHamburgerTitleBar != null)
                {
                    throw new ArgumentException("A HamburgerTitleBar control has already been registered.", nameof(hamburgerTitleBar));
                }

                _registeredHamburgerTitleBar = hamburgerTitleBar;

                hamburgerTitleBar.MenuButtonClick += HamburgerTitleBar_MenuButtonClick;
            }
        }
        /// <summary>
        /// Unregisters the specified <see cref="HamburgerTitleBar"/> control.
        /// </summary>
        /// <param name="hamburgerTitleBar">The <see cref="HamburgerTitleBar"/> control.</param>
        internal void UnregisterHamburgerTitleBar(HamburgerTitleBar hamburgerTitleBar)
        {
            lock (_registeredControlsLock)
            {
                if (_registeredHamburgerTitleBar != hamburgerTitleBar)
                {
                    throw new ArgumentException("The registered HamburgerTitleBar control is not the same as the one indicated.", nameof(hamburgerTitleBar));
                }

                hamburgerTitleBar.MenuButtonClick -= HamburgerTitleBar_MenuButtonClick;

                _registeredHamburgerTitleBar = null;
            }
        }
        /// <summary>
        /// Registers the specified <see cref="HamburgerTitleBar"/> control.
        /// </summary>
        /// <param name="hamburgerTitleBar">The <see cref="HamburgerTitleBar"/> control.</param>
        internal void RegisterHamburgerTitleBar(HamburgerTitleBar hamburgerTitleBar)
        {
            lock (_registeredControlsLock)
            {
                if (_registeredHamburgerTitleBar != null)
                {
                    throw new ArgumentException("A HamburgerTitleBar control has already been registered.", nameof(hamburgerTitleBar));
                }

                _registeredHamburgerTitleBar = hamburgerTitleBar;

                hamburgerTitleBar.MenuButtonClick += HamburgerTitleBar_MenuButtonClick;
            }
        }