public IList<string> FindPartialFiles(string viewPath, IViewFolder viewFolder)
        {
            var results = new List<string>();

            string controllerPath = Path.GetDirectoryName(viewPath);
            foreach (var view in viewFolder.ListViews(controllerPath))
            {
                string baseName = Path.GetFileNameWithoutExtension(view);
                if (baseName.StartsWith("_"))
                    results.Add(baseName.Substring(1));
            }
            foreach (var view in viewFolder.ListViews("Shared"))
            {
                string baseName = Path.GetFileNameWithoutExtension(view);
                if (baseName.StartsWith("_"))
                    results.Add(baseName.Substring(1));
            }
            return results;
        }
Beispiel #2
0
        public IList <string> ListViews(string path)
        {
            var adjusted = Adjust(path);

            if (adjusted == null)
            {
                return(new string[0]);
            }

            return(_viewFolder.ListViews(adjusted).Select(file => _subFolder + "\\" + Path.GetFileName(file)).ToArray());
        }
Beispiel #3
0
            public IList <string> ListViews(string path)
            {
                var lang = ParseLanguagePath(path);

                if (lang == null)
                {
                    return(_viewFolder.ListViews(path));
                }

                var languageExtension      = "." + lang.Language + ".spark";
                var shortLanguageExtension = lang.ShortLanguage == null ? null : "." + lang.ShortLanguage + ".spark";

                var actualViews = _viewFolder.ListViews(lang.Path);

                var adjustedViews = actualViews.Select(
                    actualPath =>
                    AlterPath(actualPath, languageExtension, lang.Prefix) ??
                    AlterPath(actualPath, shortLanguageExtension, lang.Prefix) ??
                    Path.Combine(lang.Prefix, actualPath)
                    );

                return(adjustedViews.Distinct().ToList());
            }
 public IList <string> ListViews(string path)
 {
     return(_base.ListViews(Convert(path)));
 }