private static void Code2Uml(IEnumerable <string> paths, string target) { foreach (string path in paths) { Console.WriteLine(path); Action <string> processFile = (filename) => { if (!filename.Contains("gen")) { IParser parser = new CSharpParser(); IEnumerable <IUmlObject> objects = parser.Parse(filename); List <string> lines = new List <string> (); foreach (IUmlObject obj in objects) { lines.Add(obj.ToUmlCode()); } string umlfile = filename.Replace(".cs", ".uml"); if (target.Length > 0) { umlfile = umlfile.ReplaceFirst(path, target + "/"); } Console.WriteLine("Write: " + umlfile); Files.WriteLines(umlfile, lines); } }; Files.SearchFiles(path, new string[] { ".cs" }, processFile); } }
private static void Code2Uml(IEnumerable<string> paths, string target) { foreach (string path in paths) { Console.WriteLine (path); Action<string> processFile = (filename) => { if (!filename.Contains ("gen")) { IParser parser = new CSharpParser (); IEnumerable<IUmlObject> objects = parser.Parse (filename); List<string> lines = new List<string> (); foreach (IUmlObject obj in objects) { lines.Add (obj.ToUmlCode ()); } string umlfile = filename.Replace (".cs", ".uml"); if (target.Length > 0) { umlfile = umlfile.ReplaceFirst (path, target + "/"); } Console.WriteLine ("Write: " + umlfile); Files.WriteLines (umlfile, lines); } }; Files.SearchFiles (path, new string[]{".cs"}, processFile); } }