public bool ImportWinResources(string basePhysicalPath)
{
if (basePhysicalPath == null)
basePhysicalPath = BasePhysicalPath;
// basePhysicalPath = basePhysicalPath.ToLower();
if (!basePhysicalPath.EndsWith("\\"))
basePhysicalPath += "\\";
// We need to create a Web relative path (ie. admin/myresources.resx)
string relPath = basePhysicalPath.Replace(BasePhysicalPath, "");
relPath = relPath.Replace("\\", "/");
// Import the base path first
ImportDirectoryResources(basePhysicalPath, relPath);
// Recurse into child folders
string[] directories;
try
{
directories = Directory.GetDirectories(basePhysicalPath);
}
catch
{
return false;
}
foreach (string dirString in directories)
{
DirectoryInfo directory = new DirectoryInfo(dirString);
string dir = directory.Name;
if (dir == "" || ("|bin|obj|.git|.svn|_svn|app_code|app_themes|app_data|migrations|node_modules|bower_components|".Contains("|" + dir.ToLower() + "|")))
continue;
ImportWinResources(basePhysicalPath + dir + "\\");
}
return true;
}