Пример #1
0
        private void OnDelayTimerExpire(object sender, EventArgs e)
        {
            if (_itemDelayTimer != null)
            {
                _itemDelayTimer.Stop();

                // If the target and current sub menu target are the same, then there is nothing
                // to do as we would only tell the sub menu to be removed and shown again.
                if (_target != _targetSubMenu)
                {
                    // Do we know a target that was instructed to show any sub menu?
                    if (_targetSubMenu != null)
                    {
                        // Inform the same target to remove any showing sub menu
                        _targetSubMenu.ClearSubMenu();
                        _targetSubMenu = null;
                    }

                    // If we still have a target and it has a sub menu
                    if ((_target != null) && _target.HasSubMenu)
                    {
                        // Remember we told the target to show any sub menu
                        _targetSubMenu = _target;
                        _target.ShowSubMenu();
                    }
                }
            }
        }