示例#1
0
        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();
            }
        }
示例#2
0
文件: frmMain.cs 项目: aweisser/PMCS
 public void OpenProject()
 {
     this.listBox1.Items.Clear();
     this.treeView1.Nodes.Clear();
     this.lblPath.Text = "";
     fbd.ShowDialog();
     this.lblPath.Text = fbd.SelectedPath;
     if ((fbd.SelectedPath != null) && (fbd.SelectedPath != ""))
     {
         inputSource.ProjectFileCount(fbd.SelectedPath.ToString());
     }
     inputSource.ElementID = 0;
     inputSource.ListOfNamespaces.Clear();
     this.progressBar.Maximum = inputSource.FileCount;
 }