Пример #1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.Write("Please enter Command Line Arguments.\n\n");
                return;
            }
            Console.Write("Current path:\n {0}", Directory.GetCurrentDirectory());
            CommandLine.CommandLineProcessing clp = new CommandLine.CommandLineProcessing();
            CodeAnalysis.FileMgr fm = new CodeAnalysis.FileMgr();

            clp.ProcessCommandLine(args);
            fm.setrecurseflag(clp.getrecursiveflag());
            fm.setPattern(clp.getPatterns());
            fm.findFiles(clp.getPath());

            CodeAnalysis.Analyzer.doAnalysis(fm.getFiles().ToArray(), clp.getrelationshipflag());
            CodeAnalysis.Display dis = new CodeAnalysis.Display();
            dis.Displayfiles(fm.getFiles());
            try {
                CodeAnalysis.XML xml = new CodeAnalysis.XML();
                dis.DisplayData(clp);
                xml.XMLWrite(clp.getrelationshipflag());
            }
            catch (Exception ex) {
                Console.Write("\n\n  {0}\n", ex.Message);
            }
        }
 /// <summary>
 /// //////////////////////////////////////////////////////////////
 /// analyzer call or the executive for analyzer project
 public void analyzercall(clientconnect cc)
 {
       if (analyzeproj_.Count == 0)
       {
       //    Console.Write("Please enter Command Line Arguments.\n\n");
           //return null;
       }
       Console.Write("\n\nCurrent path:\n {0}", Directory.GetCurrentDirectory());
       CommandLine.CommandLineProcessing clp = new CommandLine.CommandLineProcessing();
       string path = Directory.GetCurrentDirectory();
       path += "/Servers/TestProjects";           
       Console.Write("{0}",path);
       if(CodeAnalysis.Repository.getInstance()!=null)
           CodeAnalysis.Repository.clearInstance();  
       CodeAnalysis.FileMgr fm = new CodeAnalysis.FileMgr();
       string str2 = "";
       foreach (string str1 in cc.patt_)
           str2 += str1;
       string[] commandlinestr = {path,"/X",str2};
       clp.ProcessCommandLine(commandlinestr);
       fm.setrecurseflag(cc.recurse_);
       fm.findFiles(path);
       List<string> files = new List<string>();
       foreach (string str in fm.getFiles())
       {
           foreach (string str1 in cc.analproj_)
               if (str.Contains(str1))
                   files.Add(str);
       }            
       CodeAnalysis.Analyzer.doAnalysis(files.ToArray(), true);
       CodeAnalysis.Display dis = new CodeAnalysis.Display();
       dis.Displayfiles(files);     
       try
       {
           CodeAnalysis.XML xml = new CodeAnalysis.XML();
           dis.DisplayData(clp);
           if (clp.getxmlflag())
               xml.XMLWrite(clp.getrelationshipflag());
           var xmldoc = XDocument.Load("Output.xml");
           cc.data_ = xmldoc.ToString();
       }
       catch (Exception ex)
       {
           Console.Write("\n\n  {0}\n", ex.Message);
       }
 }
Пример #3
0
        static void Main(string[] args)
        {
            CommandLine.CommandLineProcessing clp = new CommandLine.CommandLineProcessing();
            clp.ProcessCommandLine(args);
            Display d = new Display();
            d.DisplayData(clp);

        }