public CondensedTypeGraph CompressNamespaces()
 {
     CompressTypesByNamespaceAlg cgalgo = new CompressTypesByNamespaceAlg(this);
     CondensedTypeGraph cg = new CondensedTypeGraph();
     cgalgo.Create(cg);
     return cg;
 }
        public CondensedTypeGraph CompressNamespaces()
        {
            CompressTypesByNamespaceAlg cgalgo = new CompressTypesByNamespaceAlg(this);
            CondensedTypeGraph          cg     = new CondensedTypeGraph();

            cgalgo.Create(cg);
            return(cg);
        }
Example #3
0
 public void Create(CondensedTypeGraph cg)
 {
     if (cg == null)
     {
         throw new ArgumentNullException("cg");
     }
     destcg = cg;
     dfs.Compute();
 }
        public CondensedTypeGraph CondenseGraph()
        {
            CondensationGraphAlgorithm cgalgo = new CondensationGraphAlgorithm(this);

            cgalgo.InitCondensationGraphVertex += new CondensationGraphVertexEventHandler(CGVertexHandler);
            CondensedTypeGraph cg = new CondensedTypeGraph();

            cgalgo.Create(cg);
            return(cg);
        }
Example #5
0
        private string RenderCondGraph(CondensedTypeGraph g, GraphvizImageType imageType, string outputFile)
        {
            string            output;
            GraphvizAlgorithm renderer;

            renderer                           = new GraphvizAlgorithm(g);
            renderer.ImageType                 = imageType;
            renderer.FormatCluster            += new FormatClusterEventHandler(renderer_FormatCluster);
            renderer.GraphFormat.IsCentered    = true;
            renderer.GraphFormat.RankDirection = GraphvizRankDirection.TB;
            renderer.FormatVertex             += new FormatVertexEventHandler(FormatCCCVertex);
            renderer.FormatEdge               += new FormatEdgeEventHandler(graphvis_edgeFormatterNN);
            output = renderer.Write(outputFile);
            return(output);
        }
Example #6
0
        public void Execute()
        {
            DetermineClassDeps  dcd = new DetermineClassDeps();
            TypeDependencyGraph tdg = new TypeDependencyGraph(false);

            dcd.AssemblyFile      = AssemblyFileName;
            dcd.IgnoreOutsideRefs = false;
            dcd.Execute();
            tdg.LoadClassDependencies(dcd, true);
            this._graph = tdg.CondenseGraph();

            WritePDBasXML pdbxmlWritterTask = new WritePDBasXML();

            pdbxmlWritterTask.AssemblyName = new TaskItem(this.AssemblyFileName);

            if (pdbxmlWritterTask.Execute())
            {
                this._pDBDataFile = pdbxmlWritterTask.PDBAsXmlFile.ItemSpec;
                pdbXPathDoc       = new XPathDocument(PDBDataFile);
                pdbNav            = pdbXPathDoc.CreateNavigator();
            }



            Directory.CreateDirectory(OutputDirectory);
            foreach (CondensedVertex va in Graph.Vertices)
            {
                if (va.ImutableExternalType)
                {
                    continue;
                }
                va.AssemblyName = GetAssemblyName(va);
                if (va.AssemblyName.StartsWith("<"))
                {
                    continue;
                }

                va.AssemblyGUID = Guid.NewGuid();
                va.ProjectFile  = va.AssemblyName + ".csproj"; // );//Path.Combine(OutputDirectory,
            }

            foreach (CondensedVertex vassem in Graph.Vertices)
            {
                CreateProjectFile(vassem);
            }

            CreateSolutionFile();
        }
Example #7
0
 private void RenderProjectFiles(CondensedTypeGraph condG)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Example #8
0
        private string RenderCondGraph(CondensedTypeGraph g, GraphvizImageType imageType, string outputFile)
        {
            string output;
            GraphvizAlgorithm renderer;

            renderer = new GraphvizAlgorithm( g);
            renderer.ImageType = imageType;
            renderer.FormatCluster += new FormatClusterEventHandler(renderer_FormatCluster);
            renderer.GraphFormat.IsCentered = true;
            renderer.GraphFormat.RankDirection = GraphvizRankDirection.TB;
            renderer.FormatVertex += new FormatVertexEventHandler(FormatCCCVertex);
            renderer.FormatEdge += new FormatEdgeEventHandler(graphvis_edgeFormatterNN);
            output = renderer.Write(outputFile);
            return output;
        }
 public void Create(CondensedTypeGraph cg)
 {
     if (cg == null) throw new ArgumentNullException("cg");
     destcg = cg;
     dfs.Compute();
 }
        public void Execute()
        {
            DetermineClassDeps dcd = new DetermineClassDeps();
            TypeDependencyGraph tdg = new TypeDependencyGraph(false);
            dcd.AssemblyFile = AssemblyFileName;
            dcd.IgnoreOutsideRefs = false;
            dcd.Execute();
            tdg.LoadClassDependencies(dcd, true);
            this._graph = tdg.CondenseGraph();

            WritePDBasXML pdbxmlWritterTask = new WritePDBasXML();
            pdbxmlWritterTask.AssemblyName = new TaskItem(this.AssemblyFileName);

            if (pdbxmlWritterTask.Execute())
            {
                this._pDBDataFile = pdbxmlWritterTask.PDBAsXmlFile.ItemSpec;
                pdbXPathDoc = new XPathDocument(PDBDataFile);
                pdbNav = pdbXPathDoc.CreateNavigator();
            }

            Directory.CreateDirectory(OutputDirectory);
            foreach (CondensedVertex va in Graph.Vertices)
            {
                if (va.ImutableExternalType) continue;
                va.AssemblyName =  GetAssemblyName(va);
                if (va.AssemblyName.StartsWith("<"))
                    continue;

                va.AssemblyGUID = Guid.NewGuid();
                va.ProjectFile = va.AssemblyName + ".csproj"; // );//Path.Combine(OutputDirectory,
            }

            foreach (CondensedVertex vassem in Graph.Vertices)
            {
                CreateProjectFile(vassem);
            }

            CreateSolutionFile();
        }
 public CondensedTypeGraph CondenseGraph()
 {
     CondensationGraphAlgorithm cgalgo = new CondensationGraphAlgorithm(this);
     cgalgo.InitCondensationGraphVertex += new CondensationGraphVertexEventHandler(CGVertexHandler);
     CondensedTypeGraph cg = new CondensedTypeGraph();
     cgalgo.Create(cg);
     return cg;
 }
Example #12
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string output;

            dcd.AssemblyFile      = @"..\..\..\MBUnitTests\bin\Debug\MBUnitTests.exe";
            dcd.IgnoreOutsideRefs = false;
            dcd.Execute();
            TypeDependencyGraph tdg = new TypeDependencyGraph(false);

            tdg.LoadClassDependencies(dcd, true);
            output = RenderAnalysisGraph(tdg, imageType, "tdg");

//			output = RenderAnalysisGraph(tdg, imageType, "NamespaceOutboundG");


            ////CondensedTypeGraph cond_CompNS_CondG = tdg.
            //TypeDependencyGraph Analysistdg;
            //Analysistdg = tdg.TypeDepAnalysis(new List<TypeReference>());
            //RenderAnalysisGraph(Analysistdg, imageType, "Analysistdg");
            //return;
            ////output = RenderCondGraph(cond_CompNS_CondG, imageType, "analysistNew");

            //return;
            CondensedTypeGraph condG = tdg.CondenseGraph();

            output = RenderCondGraph(condG, imageType, "condensedGraph");
            condG.CompactNS(true);
            output = RenderCondGraph(condG, imageType, "compactNS");

            foreach (CondensedVertex v in condG.Vertices)
            {
                Debug.WriteLine(v.ContainedTypes.Count.ToString());
            }

            RenderProjectFiles rpf = new RenderProjectFiles();

            //rpf.PDBDataFile = @"..\..\..\MBUnitTests\bin\Debug\MBUnitTests.pdb.xml";
            GeneratePDBXml(rpf);
            rpf.Graph           = condG;
            rpf.OutputDirectory = "Projects";
            rpf.NameHint        = "mbuTests";
            rpf.Execute();



            //CondensedTypeGraph NScompressed = condG.CompressNamespaces();
            //CondensedTypeGraph NScompressedandCondensed = NScompressed.CondenseGraph();


            //List<TypeReference> analysisList = cond_CompNS_CondG.FindBigestAssembly().ContainedTypes;
//			Analysistdg =  tdg.TypeDepAnalysis(analysisList);



            //output = RenderAnalysisGraph(tdg, imageType, "analisisRemoved");


            //output = RenderCondGraph(NScompressedandCondensed, imageType, "NS2");
            //output = RenderCondGraph(condG, imageType, "Cond");
            return;



            //CondensedTypeGraph ccc = tdg.CompressGraph();
            //CondensedTypeGraph cccNS = ccc.CompressNamespaces();
            //= cccNS.CompressGraph();



            //Debug.WriteLine(ccc.VerticesCount.ToString());
            //Debug.WriteLine(tdg.VerticesCount.ToString());
            //Debug.WriteLine(ccc.EdgesCount.ToString());



            //pictureBox1.Load(output);


            ////            return;
            //Debug.WriteLine("Render full graph");
            //return;
            //output = RenderFullGraph(tdg, imageType);
            //pictureBox3.Load(output);
        }
Example #13
0
 private void RenderProjectFiles(CondensedTypeGraph condG)
 {
     throw new Exception("The method or operation is not implemented.");
 }