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 AddAllControllers(IDList list)
 {
     foreach (var controller in ControllerType.GetControllerIds(ParentId.ToGuid()))
     {
         list.Add(new ID(controller.Key));
     }
 }