public IEnumerable <Type> GetComponentType <ICategory>() { var category = typeof(ICategory).GetViewComponentNamespace(); if (!CategoryComponents.ContainsKey(category)) { CategoryComponents.Add(category, new LinkedList <Type>()); } return(CategoryComponents[category]); }
public void RegisterComponent <IComponent>(string category) where IComponent : IViewComponent, new() { if (!CategoryComponents.ContainsKey(category)) { CategoryComponents.Add(category, new LinkedList <Type>()); } if (!ComponentCategories.ContainsKey(typeof(IComponent))) { ComponentCategories.Add(typeof(IComponent), new LinkedList <string>()); } CategoryComponents[category].AddLast(typeof(IComponent)); ComponentCategories[typeof(IComponent)].AddLast(category); }