예제 #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");
        }
예제 #2
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());
        }
예제 #3
0
파일: FileMgr.cs 프로젝트: WaverV/Projects
        //------------------<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");


        }
예제 #4
0
파일: FileMgr.cs 프로젝트: WaverV/Projects
 //-----------<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();
 }