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;
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 private IReadOnlyList <NgDirective> GetDirectives(NgHierarchy hierarchy)
 {
     return(this.DirectiveProviders.SelectMany(p => p.GetElements(hierarchy)).ToReadOnlyList());
 }
Ejemplo n.º 4
0
 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();
 }