コード例 #1
0
        // ----------------< Build Intial Type Table on Server Start up >----------------
        public void intialTypeTable(string path)
        {
            List <string> pattern = new List <string>();

            pattern.Add("*.cs");

            FileManager fm = new FileManager();

            string[] files = fm.getFiles(path, pattern, true).ToArray();
            if (files.Length != 0)
            {
                try
                {
                    Analyzer.doAnalysis(files);

                    XMLEncoderDecoder xe = new XMLEncoderDecoder();
                    typeTable = xe.typeTableXML(Analyzer.getTypeTable());
                }
                catch { }
            }
            else
            {
                return;
            }
        }
コード例 #2
0
        // ----------------< perform In Coming dependency using Complete TypeTable >----------------
        public void dependencyAnalysisAll(string directoryName)
        {
            List <string> pattern = new List <string>();

            pattern.Add("*.cs");

            FileManager fm = new FileManager();

            string[] files = fm.getFiles(pathNameForFatching, pattern, true).ToArray();

            if (files.Length != 0)
            {
                try
                {
                    Analyzer.doRelationAnalysis(files);
                    List <ElemRelation> relationship = Analyzer.getRelationshipTable();

                    PackageDependency  pd      = new PackageDependency();
                    List <ElemPackage> package = pd.getPackageDependency();

                    RemoveDuplicate     rd            = new RemoveDuplicate();
                    List <ElemRelation> relationship1 = rd.removeDuplicate(relationship);
                    List <ElemPackage>  package1      = rd.removePDuplicate(package);

                    List <ElemRelation> relationshipTo = new List <ElemRelation>();
                    foreach (ElemRelation er in relationship1)
                    {
                        if (Path.GetDirectoryName(er.filenameto).Equals(directoryName))
                        {
                            relationshipTo.Add(er);
                        }
                    }

                    List <ElemPackage> packageTo = new List <ElemPackage>();
                    foreach (ElemPackage ep in package)
                    {
                        if (Path.GetDirectoryName(ep.filenameto).Equals(directoryName))
                        {
                            ElemPackage e = new ElemPackage();
                            e.filenamefrom = ep.filenamefrom;
                            e.filenameto   = ep.filenameto;
                            packageTo.Add(e);
                        }
                    }

                    XMLEncoderDecoder xe = new XMLEncoderDecoder();
                    dependencyAllResult = xe.dependencyResultXML(relationshipTo, packageTo);
                }
                catch { }
            }
            else
            {
                return;
            }
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Console.Write("\n Testing Filemanager");
            Console.Write("\n ================");
            string path = "../..";
            bool s = true;

            FileManager fm = new FileManager();
            fm.findFiles(path);
            List<string> files = fm.getFiles(path, fm.patterns, s);
            foreach (string file in files)
                Console.Write("\n {0}\n", file);
            Console.WriteLine();
        }
コード例 #4
0
        static void Main(string[] args)
        {
            Console.Write("\n Testing Filemanager");
            Console.Write("\n ================");
            string path = "../..";
            bool   s    = true;

            FileManager fm = new FileManager();

            fm.findFiles(path);
            List <string> files = fm.getFiles(path, fm.patterns, s);

            foreach (string file in files)
            {
                Console.Write("\n {0}\n", file);
            }
            Console.WriteLine();
        }
コード例 #5
0
        // ----------------< perform Out Going dependency using Complete TypeTable >----------------
        public void dependencyAnalysis(string directoryName)
        {
            List <string> pattern = new List <string>();

            pattern.Add("*.cs");

            FileManager fm = new FileManager();

            string[] files = fm.getFiles(directoryName, pattern, true).ToArray();

            if (files.Length != 0)
            {
                try
                {
                    Analyzer.doRelationAnalysis(files);
                    List <ElemRelation> relationship = Analyzer.getRelationshipTable();

                    PackageDependency  pd      = new PackageDependency();
                    List <ElemPackage> package = pd.getPackageDependency();

                    RemoveDuplicate     rd            = new RemoveDuplicate();
                    List <ElemRelation> relationship1 = rd.removeDuplicate(relationship);
                    List <ElemPackage>  package1      = rd.removePDuplicate(package);

                    XMLEncoderDecoder xe = new XMLEncoderDecoder();
                    dependencyResult = xe.dependencyResultXML(relationship1, package1);

                    Console.Write("\n\n {0}", dependencyResult);
                }
                catch { }
            }
            else
            {
                return;
            }
        }