예제 #1
0
        internal override bool OnPreBubbleCommand(CommandEventArgs command)
        {
            if (command.Type == CommandType.MenuCreation)
            {
                // We can assume that any control sending a MenuCreation event must be a MenuLauncher
                MenuLauncher source = (MenuLauncher)command.SourceControl;

                // If there's already an open menu, we can just ignore this creation event
                // since it is likely a submenu launching
                if (_currentlyOpenedMenu != null)
                {
                    return(base.OnPreBubbleCommand(command));
                }

                _currentlyOpenedMenu = source;

                ShowGlass();
            }
            else if (command.Type == CommandType.MenuClose)
            {
                HideGlass();
                _currentlyOpenedMenu = null;
            }

            return(base.OnPreBubbleCommand(command));
        }
예제 #2
0
파일: root.cs 프로젝트: modulexcite/IL2JS
        /// <summary>
        /// Closes a Menu and all open Menus nested under it
        /// </summary>
        /// <param name="parent">The MenuLauncher that opened the Menu to be closed</param>
        internal void CloseMenuStack(MenuLauncher par)
        {
            // If the menu launcher stack is gone, all menus should be closed already
            if (CUIUtility.IsNullOrUndefined(MenuLauncherStack))
                return;

            _closeInProgress = true;
            int index = MenuLauncherStack.IndexOf(par);

            // For each menu nested in the parent, call CloseMenu
            for (int i = MenuLauncherStack.Count - 1; i >= index; i--)
            {
                ((MenuLauncher)MenuLauncherStack[i]).CloseMenu();
                MenuLauncherStack.RemoveAt(i);
            }
            _closeInProgress = false;
        }
예제 #3
0
파일: root.cs 프로젝트: modulexcite/IL2JS
 /// <summary>
 /// Adds a menu to the Menu Stack
 /// </summary>
 /// <param name="ml">The MenuLauncher that opened the Menu</param>
 internal void AddMenuLauncherToStack(MenuLauncher ml)
 {
     if (CUIUtility.IsNullOrUndefined(MenuLauncherStack))
         MenuLauncherStack = new List<MenuLauncher>();
     MenuLauncherStack.Add(ml);
 }
예제 #4
0
        internal override bool OnPreBubbleCommand(CommandEventArgs command)
        {
            if (command.Type == CommandType.MenuCreation)
            {
                // We can assume that any control sending a MenuCreation event must be a MenuLauncher
                MenuLauncher source = (MenuLauncher)command.SourceControl;

                // If there's already an open menu, we can just ignore this creation event
                // since it is likely a submenu launching
                if (_currentlyOpenedMenu != null)
                    return base.OnPreBubbleCommand(command);

                _currentlyOpenedMenu = source;

                ShowGlass();
            }
            else if (command.Type == CommandType.MenuClose)
            {
                HideGlass();
                _currentlyOpenedMenu = null;
            }

            return base.OnPreBubbleCommand(command);
        }