public static MyResourceDataFileList Execute(string rootPath, string language, System.Collections.IList containerClassNames) { if (rootPath == null || rootPath.Length == 0 || Directory.Exists(rootPath) == false) { return(null); } if (language != null && language.Length > 0) { var fns = Directory.GetFiles(rootPath, "*.resources"); foreach (var fn in fns) { Console.WriteLine("Merge resource file:" + fn); CombineResourceFile(fn, language, fn); } } if (containerClassNames != null && containerClassNames.Count > 0) { var values = new MyResourceDataFileList(); foreach (var name in containerClassNames) { var fn = Path.Combine(rootPath, name + EXT_resources); if (File.Exists(fn)) { values.Add(new MyResourceDataFile(fn)); } } //values.SaveToStdFileName(rootPath); return(values); } return(null); }
public static MyResourceDataFileList ExecuteByExe(string exeFileName, string rootPath, string languageName, System.Collections.IList containerClassNames) { var args = new StringBuilder(); args.Append("\"rootpath=" + rootPath + "\""); if (languageName != null && languageName.Length > 0) { args.Append(" language=" + languageName); } if (containerClassNames != null && containerClassNames.Count > 0) { args.Append(" \"containerclassnames="); for (int iCount = 0; iCount < containerClassNames.Count; iCount++) { args.Append(containerClassNames[iCount]); if (iCount != containerClassNames.Count - 1) { args.Append(','); } } args.Append('"'); } //___Main(ParseCommandLineArgs(args.ToString())); RunExe(exeFileName, args.ToString()); var result = new MyResourceDataFileList(); if (result.LoadFromStdFileName(rootPath)) { return(result); } else { return(null); } }