示例#1
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;
            }
        }
示例#2
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;
            }
        }