public static void Run(string[] args) { string sourcePath = null; string outputFile = null; string whitelistRegexp = null; string blacklistRegexp = null; foreach (string arg in args) { if (arg.StartsWith("/")) { if (arg.StartsWith("/o:")) { outputFile = arg.Substring(3); } if (arg.StartsWith("/w:")) { whitelistRegexp = arg.Substring(3); } if (arg.StartsWith("/b:")) { blacklistRegexp = arg.Substring(3); } } else { sourcePath = arg; } } InputSource inputSource = new InputSource(); inputSource.WhitelistRegexp = whitelistRegexp; inputSource.BlacklistRegexp = blacklistRegexp; inputSource.ElementID = 0; inputSource.ListOfNamespaces.Clear(); Log("Counting files in {0}", sourcePath); inputSource.ProjectFileCount(sourcePath); Log("Reading files"); inputSource.ReadProject(sourcePath, x => Log("- {0}", x)); inputSource.ProcessNamespaceHierarchy(); Log("Writing output to {0}", outputFile); var writer = (outputFile != null) ? new StreamWriter(outputFile) : Console.Out; new MseOutput().WriteMse(inputSource.ListOfNamespaces, writer); if (outputFile != null) { writer.Close(); } }
public void ParseProject() { this.progressBar.Value = 0; this.progressBar.Visible = true; if (!string.IsNullOrEmpty(fbd.SelectedPath)) { inputSource.ReadProject(fbd.SelectedPath, x => progressBar.Value++); PopulateText(); PopulateTree(); } else { MessageBox.Show("Please select a project path"); } //List<FNamespace> fmN = new List<FNamespace>(); //fmN = inputSource.ListOfNamespaces; this.progressBar.Visible = false; }