public virtual bool TryGetProjectFileName(string itemPath, string templateName, out string projectFileName, out string format)
        {
            projectFileName = string.Empty;
            format          = string.Empty;

            itemPath = '/' + PathHelper.NormalizeItemPath(itemPath).TrimStart('/');

            foreach (var mapper in WebsiteItemPathToProjectDirectories)
            {
                if (mapper.TryGetProjectFileName(itemPath, templateName, out projectFileName, out format))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
 public void NormalizeItemPath()
 {
     Assert.AreEqual("/sitecore/test.txt", PathHelper.NormalizeItemPath("\\sitecore\\test.txt"));
     Assert.AreEqual("/sitecore/test.txt", PathHelper.NormalizeItemPath("/sitecore/test.txt"));
     Assert.AreEqual("test.txt", PathHelper.NormalizeItemPath("test.txt"));
 }