public void ParseModule(string[] dirs, String module, Dictionary <string, string> prefix, Dictionary <string, string> postfix, Dictionary <string, string> country, Dictionary <string, string> region, string pattern, CSVDumper dumper) { switch (module) { case ModuleDirs.Name.CLASS: Console.WriteLine("[Parsing CLASS ...]"); List <ClassData> classes = DirParser.Parse(dirs, ModuleDirs.GetModuleDir(module), prefix, postfix, country, region, ClassData.Parse, pattern); dumper.Dump(classes); break; case ModuleDirs.Name.TABLE: Console.WriteLine("[Parsing TABLE ...]"); List <TableData> tables = DirParser.Parse(dirs, ModuleDirs.GetModuleDir(module), prefix, postfix, country, region, TableData.Parse, pattern); dumper.Dump(tables); break; case ModuleDirs.Name.FORM: Console.WriteLine("[Parsing FORM ...]"); List <FormData> forms = DirParser.Parse(dirs, ModuleDirs.GetModuleDir(module), prefix, postfix, country, region, FormData.Parse, pattern); dumper.Dump(forms); break; case ModuleDirs.Name.ENUM: Console.WriteLine("[Parsing ENUM ...]"); List <EnumData> enums = DirParser.Parse(dirs, ModuleDirs.GetModuleDir(module), prefix, postfix, country, region, EnumData.Parse, pattern); dumper.Dump(enums); break; case ModuleDirs.Name.MAP: Console.WriteLine("[Parsing MAP ...]"); List <MapData> maps = DirParser.Parse(dirs, ModuleDirs.GetModuleDir(module), prefix, postfix, country, region, MapData.Parse, pattern); dumper.Dump(maps); break; case ModuleDirs.Name.QUERY: Console.WriteLine("[Parsing QUERY ...]"); List <QueryData> queries = DirParser.Parse(dirs, ModuleDirs.GetModuleDir(module), prefix, postfix, country, region, QueryData.Parse, pattern); dumper.Dump(queries); break; case ModuleDirs.Name.VIEW: Console.WriteLine("[Parsing VIEW ...]"); List <ViewData> views = DirParser.Parse(dirs, ModuleDirs.GetModuleDir(module), prefix, postfix, country, region, ViewData.Parse, pattern); dumper.Dump(views); break; case ModuleDirs.Name.SSRS: Console.WriteLine("[Parsing SSRS ...]"); List <SSRSData> ssrs = DirParser.Parse(dirs, ModuleDirs.GetModuleDir(module), prefix, postfix, country, region, SSRSData.Parse, pattern); dumper.Dump(ssrs); break; } }
public static Argument Parse(string[] args) { Argument argument = new Argument(); int i = 0; while (i < args.Length) { args[i] = args[i].ToUpper(); if (args[i] == PATTERN) { if (!args[i + 1].StartsWith("-")) { argument.pattern = args[i + 1]; i++; } i++; } else if (args[i] == OUTPUT) { if (!args[i + 1].StartsWith("-")) { argument.output = args[i + 1]; i++; } i++; } else if (args[i] == DIRS) { List <string> dirs = new List <string>(); while (++i < args.Length && !args[i].StartsWith("-")) { dirs.Add(args[i]); } argument.dirs = dirs.ToArray(); } else if (args[i] == MODULES) { List <string> modules = new List <string>(); while (++i < args.Length && !args[i].StartsWith("-")) { if (ModuleDirs.IsValidModule(args[i])) { modules.Add(args[i].ToUpper()); } } argument.modules = modules.ToArray(); } else if (args[i] == OWNERSHIP) { while (++i < args.Length && !args[i].StartsWith("-")) { ParseOwnership(argument.prefixOwnership, argument.postfixOwnership, args[i]); } } else if (args[i] == COUNTRY) { while (++i < args.Length && !args[i].StartsWith("-")) { ParseCountry(argument.country, args[i]); } } else if (args[i] == REGION) { while (++i < args.Length && !args[i].StartsWith("-")) { ParseRegion(argument.region, args[i]); } } else if (args[i] == TAGREGION) { while (++i < args.Length && !args[i].StartsWith("-")) { ParseTagRegion(argument.tagRegion, args[i]); } } else { ++i; } } return(argument); }