public NgHierarchy Get(string path) { int index = path.LastIndexOf("app"); if (index > -1) { var rootPath = path.Substring(0, index); var hierarchy = new NgHierarchy() { RootPath = rootPath, }; hierarchy.Directives = new Lazy<IReadOnlyList<NgDirective>>(() => GetDirectives(hierarchy)); hierarchy.Controllers = new Lazy<IReadOnlyList<NgController>>(() => GetControllers(hierarchy)); hierarchy.States = new Lazy<IReadOnlyList<NgState>>(() => GetStates(hierarchy)); return hierarchy; } else { return NgHierarchy.Null; } }
public NgHierarchy Get(string path) { int index = path.LastIndexOf("app"); if (index > -1) { var rootPath = path.Substring(0, index); var hierarchy = new NgHierarchy() { RootPath = rootPath, }; hierarchy.Directives = new Lazy <IReadOnlyList <NgDirective> >(() => GetDirectives(hierarchy)); hierarchy.Controllers = new Lazy <IReadOnlyList <NgController> >(() => GetControllers(hierarchy)); hierarchy.States = new Lazy <IReadOnlyList <NgState> >(() => GetStates(hierarchy)); return(hierarchy); } else { return(NgHierarchy.Null); } }
private IReadOnlyList <NgDirective> GetDirectives(NgHierarchy hierarchy) { return(this.DirectiveProviders.SelectMany(p => p.GetElements(hierarchy)).ToReadOnlyList()); }
private IReadOnlyList <NgController> GetControllers(NgHierarchy hierarchy) { return(this.ControllerProviders.SelectMany(p => p.GetElements(hierarchy)).ToReadOnlyList()); }
private IReadOnlyList<NgDirective> GetDirectives(NgHierarchy hierarchy) { return this.DirectiveProviders.SelectMany(p => p.GetElements(hierarchy)).ToReadOnlyList(); }
private IReadOnlyList<NgController> GetControllers(NgHierarchy hierarchy) { return this.ControllerProviders.SelectMany(p => p.GetElements(hierarchy)).ToReadOnlyList(); }