private void GetResxFiles(string path, RadTreeNodeEventArgs e) { foreach (string file in Directory.GetFiles(path, "*.resx")) { var fileInfo = new FileInfo(file); var match = FileInfoRegex.Match(fileInfo.Name); if (match.Success && match.Groups[1].Value.ToLowerInvariant() != "en-us") { continue; } var node = new RadTreeNode { Value = fileInfo.FullName, Text = fileInfo.Name.Replace(".resx", "") }; e.Node.Nodes.Add(node); } }
/// <summary> /// Gets all system default resource files /// </summary> /// <param name = "fileList">List of found resource files</param> /// <param name = "path">Folder to search at</param> /// <remarks> /// </remarks> private static void GetResourceFiles(SortedList fileList, string path) { var folders = Directory.GetDirectories(path); DirectoryInfo objFolder; foreach (var folder in folders) { objFolder = new DirectoryInfo(folder); bool resxFilesDirectory = (objFolder.Name.ToLowerInvariant() == Localization.LocalResourceDirectory.ToLowerInvariant()) || (objFolder.Name.ToLowerInvariant() == Localization.ApplicationResourceDirectory.Replace("~/", "").ToLowerInvariant()) || (folder.ToLowerInvariant().EndsWith("\\portals\\_default")); if (resxFilesDirectory) { // found local resource folder, add resources foreach (string file in Directory.GetFiles(objFolder.FullName, "*.resx")) { var fileInfo = new FileInfo(file); var match = FileInfoRegex.Match(fileInfo.Name); if (match.Success && match.Groups[1].Value.ToLowerInvariant() != "en-us") { continue; } fileList.Add(fileInfo.FullName, fileInfo); } } else { GetResourceFiles(fileList, folder); } } }