コード例 #1
0
 public void Configure(FilePool files, ScriptGraph graph)
 {
     // TODO -- need to use the virtual path provider to register the relative path here
     files
         .FilesMatching(file => true)
         .Each(file => graph.RegisterScript(file.Name, file.FullName));
 }
コード例 #2
0
        public void Configure(FilePool files, ScriptGraph graph)
        {
            files
                .FilesMatching(file => file.Extension == "js")
                .Each(file =>
                          {
                              using(var reader = new StreamReader(file.FullName))
                              {
                                  string line;
                                  while((line = reader.ReadLine()) != null)
                                  {
                                      var matches = ReferenceExpression.Matches(line);
                                      if(matches.Count == 0)
                                      {
                                          continue;
                                      }

                                      var path = matches[0].Groups["path"].Value;
                                      var script = getScript(graph, file.Name);
                                      var dependency = getScript(graph, path);
                                      if(script == null || dependency == null)
                                      {
                                          continue;
                                      }

                                      script.AddDependency(dependency);
                                  }
                              }
                          });
        }