Example #1
0
 public IEnumerable <string> SharedViewPathsForOrigin(string origin)
 {
     return(_graph.SharingsFor(origin)
            .SelectMany(x => _templates
                        .ByOrigin(x)
                        .Select(t => t.ViewPath.DirectoryPath())
                        .Where(path => _builder.SharedFolderNames.Any(path.EndsWith))
                        .Select(t => t))
            .Distinct());
 }
        private IEnumerable <string> getDirectories(ITemplate template, bool includeDirectAncestor)
        {
            var directories = new List <string>();

            var locals = _builder.BuildBy(template.FilePath, template.RootPath, includeDirectAncestor);

            directories.AddRange(locals);

            _graph.SharingsFor(template.Origin).Each(sh =>
            {
                var root = _templates.ByOrigin(sh).FirstValue(t => t.RootPath);
                if (root == null)
                {
                    return;
                }

                var sharings = _builder.BuildBy(root);
                directories.AddRange(sharings);
            });

            return(directories);
        }