示例#1
0
        //------------------<Test Stub for File Manager>----------------------

#if (TEST_FILEMGR)
        static void Main(string[] args)
        {
            Console.Write("\n  Testing FileMgr Class");
            Console.Write("\n =======================\n");

            string        path     = "../../";
            List <string> patterns = new List <string>();
            List <string> options  = new List <string>();

            options.Add("/S");
            patterns.Add("*.cs");

            FileMgr fm = new FileMgr();

            fm.addPattern("*.cs");
            fm.findFiles("../../");
            fm.subDirectoriesCheck(options);


            List <string> files = fm.getFiles1();

            string[] files1 = fm.getFiles(path, patterns);
            for (int i = 0; i < files1.Length; i++)
            {
                Console.WriteLine("\n{0}", files1[i]);
            }
            Console.Write("\n\n");
        }
 static public string[] getFiles(string path)
 {
   FileMgr fm = new FileMgr();
   fm.addPattern("*.cs");
   fm.findFiles(path);
   return fm.getFiles();
 }
示例#3
0
 static public string[] getFiles(string path, List<string> patterns) { 
     FileMgr fm=new FileMgr();
     foreach (string pattern in patterns)
         fm.addPattern(pattern);
     fm.findFiles(path);
     return fm.getFiles().ToArray();
 }
示例#4
0
 public static string[] getFiles(string path, List<string> patterns, bool sub_flag)
 {
     FileMgr fm = new FileMgr();
     foreach (string pattern in patterns)
         fm.addPattern(pattern);
     fm.findFiles(path,sub_flag);                //control files will be searched
     return fm.getFiles().ToArray();
 }
示例#5
0
        static public string[] getFiles(string path)
        {
            FileMgr fm = new FileMgr();

            fm.addPattern("*.cs");
            fm.findFiles(path);
            return(fm.getFiles());
        }
示例#6
0
        //-----------<gets the files from specified path and pattern>-----------------
        public string[] getFiles(string path, List <string> patterns)
        {
            FileMgr fm = new FileMgr();

            foreach (string pattern in patterns)
            {
                fm.addPattern(pattern);
            }
            fm.findFiles(path);
            return(fm.getFiles1().ToArray());
        }
示例#7
0
 static void Main(string[] args)
 {
     Console.Write("\n  Testing FileMgr Class");
     Console.Write("\n =======================\n");
     FileMgr fm = new FileMgr();
     fm.addPattern("*.cs");
     fm.findFiles("../../");
     List<string> files = fm.getFiles();
     foreach (string file in files)
     Console.Write("\n  {0}", file);
     Console.Write("\n\n");
     
 }
示例#8
0
        static void Main(string[] args)
        {
            Console.Write("\n  Testing FileMgr class");
            Console.Write("\n =======================\n");
            FileMgr fm = new FileMgr();

            //fm.addPattern("*.cs");
            fm.findFiles("../../../");
            string[] files = fm.getFiles();
            foreach (string file in files)
            {
                Console.Write("\n  {0}", Path.GetFileName(file));
            }
            Console.Write("\n\n");
        }
示例#9
0
        static void Main(string[] args)
        {
            Console.Write("\n  Testing FileMgr Class");
            Console.Write("\n =======================\n");

            FileMgr fm = new FileMgr();

            fm.addPattern("*.cs");
            fm.findFiles("../../");
            List <string> files = fm.getFile();

            foreach (string file in files)
            {
                Console.Write("\n  {0}", file);
            }
            Console.Write("\n\n");
        }
示例#10
0
        public string[] getFiles(string path, List <string> patterns)
        {
            FileMgr fm = new FileMgr();

            try
            {
                foreach (string pattern in patterns)
                {
                    fm.addPattern(pattern);
                }
                fm.findFiles(path);
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: '{0}'", e);
            }
            return(fm.getFile().ToArray());
        }
 /// <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);
       }
 }
 static void Main(string[] args)
 {
   Console.Write("\n  Testing FileMgr class");
   Console.Write("\n =======================\n");
   FileMgr fm = new FileMgr();
   //fm.addPattern("*.cs");
   fm.findFiles("../../../");
   string[] files = fm.getFiles();
   foreach (string file in files)
     Console.Write("\n  {0}", Path.GetFileName(file));
   Console.Write("\n\n");
 }
示例#13
0
        //------------------<Test Stub for File Manager>----------------------

#if(TEST_FILEMGR)
        static void Main(string[] args)
        {
            Console.Write("\n  Testing FileMgr Class");
            Console.Write("\n =======================\n");

            string path = "../../";
            List<string> patterns = new List<string>();
            List<string> options = new List<string>();
            options.Add("/S");
            patterns.Add("*.cs");

            FileMgr fm = new FileMgr();
            fm.addPattern("*.cs");
            fm.findFiles("../../");
            fm.subDirectoriesCheck(options);


            List<string> files = fm.getFiles1();
            string[] files1 = fm.getFiles(path, patterns);
            for (int i = 0; i < files1.Length; i++)
            {
                Console.WriteLine("\n{0}", files1[i]);
            }
            Console.Write("\n\n");


        }