コード例 #1
0
 private void SetVisible(GnosisGenericMenuItemController itemController, bool visible)
 {
     ((GnosisGenericMenuItem)itemController.ControlImplementation).Hidden = !visible;
     foreach (GnosisGenericMenuItemController childController in itemController.ChildControllers)
     {
         SetVisible(childController, visible);
     }
 }
コード例 #2
0
 private void SetEnabled(GnosisGenericMenuItemController itemController, bool enabled)
 {
     ((GnosisGenericMenuItem)itemController.ControlImplementation).Disabled = !enabled;
     foreach (GnosisGenericMenuItemController childController in itemController.ChildControllers)
     {
         SetEnabled(childController, enabled);
     }
 }
コード例 #3
0
        public virtual void SelectMenuItem()
        {
            CurrentMenuItemController = this;

            //either a SystemCommand or has EventHandler(s)
            if (EventHandlers.Count == 0)
            {
                GlobalData.Singleton.SystemCommands.RunSystemCommand(((GnosisGenericMenuItem)this.ControlImplementation)._MenuTag);
            }
            else
            {
                //Actuate all EventHandlers
                foreach (GnosisEventHandler handler in EventHandlers.OrderBy(x => x.Order))
                {
                    handler.HandleEvent(this);
                }
            }
        }
コード例 #4
0
        protected virtual void Setup()
        {
            if (((GnosisGenericMenuItem)ControlImplementation).GnosisGenericMenuItems != null)
            {
                foreach (GnosisGenericMenuItem menuItem in ((GnosisGenericMenuItem)ControlImplementation).GnosisGenericMenuItems)
                {
                    GnosisGenericMenuItemController menuItemController = new GnosisGenericMenuItemController(menuItem, this);
                    ChildControllers.Add(menuItemController);
                }
            }

            if (((GnosisGenericMenuItem)ControlImplementation).EventHandlers != null)
            {
                foreach (GnosisEventHandler handler in ((GnosisGenericMenuItem)ControlImplementation).EventHandlers)
                {
                    EventHandlers.Add(handler);
                }
            }
        }
コード例 #5
0
        public void Setup()
        {
            if (((GnosisGenericMenu)ControlImplementation).GenericMenuItems != null)
            {
                foreach (GnosisGenericMenuItem menuItem in ((GnosisGenericMenu)ControlImplementation).GenericMenuItems)
                {
                    GnosisGenericMenuItemController menuItemController = new GnosisGenericMenuItemController(menuItem, this);

                    //if (menuItem.MenuTag.Equals("Search"))
                    //{
                    //    menuItemController = new GnosisGenericMenuItemController_Search(menuItem, this);
                    //}
                    //else
                    //{
                    //    menuItemController = new GnosisGenericMenuItemController(menuItem, this);

                    //}
                    GenericMenuItemControllers.Add(menuItemController);
                }
            }

            if (((GnosisGenericMenu)ControlImplementation).ToggleMenuItems != null)
            {
                foreach (GnosisGenericToggleMenuItem toggleMenuItem in ((GnosisGenericMenu)ControlImplementation).ToggleMenuItems)
                {
                    GnosisGenericToggleMenuItemController toggleMenuItemController = new GnosisGenericToggleMenuItemController(toggleMenuItem, this);
                    GenericMenuItemControllers.Add(toggleMenuItemController);
                }
            }

            if (((GnosisGenericMenu)ControlImplementation).MenuGroups != null)
            {
                foreach (GnosisGenericMenuGroup menuGroup in ((GnosisGenericMenu)ControlImplementation).MenuGroups)
                {
                    GnosisGenericMenuGroupController menuGroupController = new GnosisGenericMenuGroupController(menuGroup, this);
                    GenericMenuItemControllers.Add(menuGroupController);
                }
            }
        }
コード例 #6
0
        internal GnosisGenericMenuItemController GetMenuItemByTag(GnosisGenericMenuItem.MenuTagEnum menuTag)
        {
            GnosisGenericMenuItemController result = null;

            if (((GnosisGenericMenuItem)this.ControlImplementation)._MenuTag == menuTag)
            {
                return(this);
            }
            else if (ChildControllers.Count > 0)
            {
                foreach (GnosisGenericMenuItemController childController in ChildControllers)
                {
                    result = childController.GetMenuItemByTag(menuTag);

                    if (result != null)
                    {
                        break;
                    }
                }
            }

            return(result);
        }