示例#1
0
 public EdgeParserTest()
 {
     lexer  = new MockEdgeLexer();
     parser = new EdgeParser(lexer)
     {
         Assemblies = new HashSet <string>()
         {
             "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
         },
         Namespaces = new HashSet <string>()
         {
             "System",
             "System.Windows",
             "System.Windows.Controls",
             "System.Windows.Data",
             "System.Windows.Documents",
             "System.Windows.Input",
             "System.Windows.Media",
             "System.Windows.Media.Imaging",
             "System.Windows.Navigation",
             "System.Windows.Shapes"
         }
     };
 }
示例#2
0
 public EdgeParserTest()
 {
     lexer = new MockEdgeLexer();
     parser = new EdgeParser(lexer)
     {
         Assemblies = new HashSet<string>()
         {
             "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
         },
         Namespaces = new HashSet<string>()
         {
             "System",
             "System.Windows",
             "System.Windows.Controls",
             "System.Windows.Data",
             "System.Windows.Documents",
             "System.Windows.Input",
             "System.Windows.Media",
             "System.Windows.Media.Imaging",
             "System.Windows.Navigation",
             "System.Windows.Shapes"
         }
     };
 }
示例#3
0
文件: Program.cs 项目: sys27/Edge
        static void Main(string[] args)
        {
            string     text   = File.ReadAllText("MainView.edge");
            EdgeParser parser = new EdgeParser()
            {
                Assemblies = new HashSet <string>()
                {
                    "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
                    "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
                    "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
                    "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
                    "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
                    "PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
                    "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                },
                Namespaces = new HashSet <string>()
                {
                    "System",
                    "System.Windows",
                    "System.Windows.Controls",
                    "System.Windows.Data",
                    "System.Windows.Documents",
                    "System.Windows.Input",
                    "System.Windows.Media",
                    "System.Windows.Media.Imaging",
                    "System.Windows.Navigation",
                    "System.Windows.Shapes"
                }
            };
            var st = parser.Parse(text);
            var a  = new EdgeAnalyzer()
            {
                Assemblies = parser.Assemblies,
                Namespaces = parser.Namespaces
            };

            a.Analyze(st);
            string file = st.Build(new CSharpBuilder(), "MainView", "WPF.Views");

            File.WriteAllText("MainView.cs", file);
        }
示例#4
0
文件: Program.cs 项目: sys27/Edge
 static void Main(string[] args)
 {
     string text = File.ReadAllText("MainView.edge");
     EdgeParser parser = new EdgeParser()
     {
         Assemblies = new HashSet<string>()
         {
             "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
             "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
             "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
         },
         Namespaces = new HashSet<string>()
         {
             "System",
             "System.Windows",
             "System.Windows.Controls",
             "System.Windows.Data",
             "System.Windows.Documents",
             "System.Windows.Input",
             "System.Windows.Media",
             "System.Windows.Media.Imaging",
             "System.Windows.Navigation",
             "System.Windows.Shapes"
         }
     };
     var st = parser.Parse(text);
     var a = new EdgeAnalyzer()
     {
         Assemblies = parser.Assemblies,
         Namespaces = parser.Namespaces
     };
     a.Analyze(st);
     string file = st.Build(new CSharpBuilder(), "MainView", "WPF.Views");
     File.WriteAllText("MainView.cs", file);
 }
示例#5
0
        public void SetUp()
        {
            edgeUtility = EdgeUtility <Edge, Vertex, Weight> .Create <Edge, Vertex, Weight>();

            //fileReaderForGraphTestData = FileReaderForGraphEdges<Edge, Vertex, Weight>.CreateFileReaderForGraphEdges(new EdgeFactoryDefault());

            graphShortestPathAssertionHelper = new GraphShortestPathAssertionHelper(false);

            xmlFileReader  = new XmlFileReader();
            resourceReader = new ResourceReader();
            edgeParser     = EdgeParser <Edge, Vertex, Weight> .CreateEdgeParserDefault();


            pathFinderFactoriesForAllImplementations = PathFinderFactories.CreatePathFinderFactories();
            pathFinderFactories = new List <PathFinderFactory>();        // set to empty here before each test, so add to the list if it needs to be used

            pathsToResourcesFoldersWithXmlTestFiles = new List <string> {
                DIRECTORY_FOR_XML_TEST_FILES_FROM_BSMOCK,
                DIRECTORY_FOR_XML_TEST_FILES_FROM_YANQI,
                BASE_DIRECTORY_FOR_XML_TEST_FILES             // yes the base directory itself also currently has some xml test files
            };
            graphShortestPathAssertionHelper.SetConsoleOutputDesired(ConsoleOutputDesired.NONE);
        }