void AddAllControllers(IDList list)
 {
     foreach (var controller in ControllerType.GetControllerIds(ParentId.ToGuid()))
     {
         list.Add(new ID(controller.Key));
     }
 }
        public override ID GetParentID(ItemDefinition itemDefinition, CallContext context)
        {
            if (itemDefinition.ID == FolderId)
            {
                return(ParentId);
            }

            if (ControllerType.GetControllerType(ParentId, itemDefinition.ID) != null)
            {
                return(FolderId);
            }

            ControllerAction action;

            if ((action = ControllerAction.GetControllerAction(ParentId, itemDefinition.ID)) != null)
            {
                return(ControllerType.GetControllerIds(ParentId.ToGuid()).Where(kv => kv.Value.Type == action.ControllerType.Type)
                       .Select(kv => new ID(kv.Key)).FirstOrDefault());
            }

            //if (itemDefinition.ID == TemplateFolderId)
            //    return ItemIDs.TemplateRoot;
            //if (itemDefinition.ID == TemplateId)
            //    return TemplateFolderId;
            return(base.GetParentID(itemDefinition, context));
        }
 void AddAllActions(IDList list, ControllerType controllerType)
 {
     foreach (var action in ControllerAction.GetAllActions(ParentId.ToGuid()).Where(a => a.ControllerType.Type == controllerType.Type))
     {
         list.Add(new ID(action.Id));
     }
 }