Exemplo n.º 1
0
        public ModuleAction GetAction(int Index, ModuleAction ParentAction)
        {
            ModuleAction retAction = null;

            if (ParentAction != null)
            {
                foreach (ModuleAction tempLoopVar_modaction in ParentAction.Actions)
                {
                    ModuleAction modaction = tempLoopVar_modaction;
                    if (modaction.ID == Index)
                    {
                        retAction = modaction;
                        break;
                    }
                    if (modaction.HasChildren())
                    {
                        ModuleAction ChildAction = GetAction(Index, modaction);
                        if (ChildAction != null)
                        {
                            retAction = ChildAction;
                            break;
                        }
                    }
                }
            }
            return(retAction);
        }
 private void AddActionIDs(ModuleAction action)
 {
     if (!actions.ContainsKey(action.ID))
     {
         actions.Add(action.ID, action);
     }
     if (action.HasChildren())
     {
         foreach (ModuleAction a in action.Actions)
         {
             AddActionIDs(a);
         }
     }
 }