Пример #1
0
        public static string[] SearchScriptFiles(string basePath, string baseNamespace)
        {
            var graph = new DirectedGraph();
            //map to mark the visited vertex during traversal
            var visited = DirectedGraph.CreateMap();
            //the list of file sorted in topological order
            var shouldVisit = new List <Vertex>();
            var dirInfo     = new DirectoryInfo(basePath);

            Bundler.TraverseDirectoryTree(dirInfo, baseNamespace, graph);

            //Run DFS on the graph and produce a list of files in topological order
            List <Vertex> vertices = graph.Vertices();

            foreach (Vertex v in vertices)
            {
                DepthFirstSearch(graph, v, visited, shouldVisit);
            }

            var files = new List <string>();

            foreach (Vertex v in shouldVisit)
            {
                Trace.WriteLine(v.Name);
            }

            return(files.ToArray());
        }
Пример #2
0
        static void Main(string[] args)
        {
            string dir = @"C:\EpicSource\8.4\DLG-454545\SystemPulse\SystemPulse\Web\Scripts\SystemPulse";

            try {
                string[] files = Bundler.SearchScriptFiles(dir, "Chrono");
            }
            catch (Exception ex) {
                Trace.TraceError("ERROR:" + ex.Message);
            }
        }