コード例 #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 static ScriptTree Construct(ScriptGraph graph)
        {
            ScriptTree result = new ScriptTree();

            result.Nodes = ConstructNodes(graph.nodes, graph.connections);
            return(result);
        }
コード例 #3
0
ファイル: ScriptSet.cs プロジェクト: RobertTheGrey/fubumvc
 public void FindScripts(ScriptGraph graph)
 {
     if (_objects == null)
     {
         _objects = _includes.Select(graph.ObjectFor).ToList();
     }
 }
コード例 #4
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);
                                  }
                              }
                          });
        }
コード例 #5
0
        private void OnPasteNodes(object argument)
        {
            if (ScriptGraph == null)
            {
                return;
            }

            if (Clipboard.ContainsData("KlaxScriptNodes"))
            {
                string       nodeData = (string)Clipboard.GetData("KlaxScriptNodes");
                List <CNode> newNodes = CScriptSerializer.Instance.DeserializeObject <List <CNode> >(nodeData);
                ScriptGraph.ResolveNodesForPaste(newNodes);

                NodeGraphView graphView = (NodeGraphView)Content;
                AddNodesToGraph(newNodes, graphView.GetPasteReferenceLocation(), true);
            }
            else if (Clipboard.ContainsData(DataFormats.UnicodeText))
            {
                string data = (string)Clipboard.GetData(DataFormats.UnicodeText);
                try
                {
                    List <CNode> newNodes = CScriptSerializer.Instance.DeserializeObject <List <CNode> >(data);
                    ScriptGraph.ResolveNodesForPaste(newNodes);

                    NodeGraphView graphView = (NodeGraphView)Content;
                    AddNodesToGraph(newNodes, graphView.GetPasteReferenceLocation(), true);
                }
                catch
                {
                    LogUtility.Log("Paste failed, input text was not in the correct format");
                }
            }
        }
コード例 #6
0
 public IGrammar SetupScriptGraph()
 {
     return(Embed <ScriptGraphSetupFixture>("If the script graph is configured as")
            .Before((step, context) =>
     {
         _graph = new ScriptGraph();
         context.Store(_graph);
     }));
 }
        public void SetUp()
        {
            Directory.GetFiles(".", "*.script.config").Each(x => File.Delete(x));


            scripts   = new ScriptGraph();
            activator = new ScriptGraphConfigurationActivator(scripts, new FileSystem());

            log = new PackageRegistryLog();
        }
コード例 #8
0
        protected override void beforeEach()
        {
            var scriptGraph = new ScriptGraph();

            scriptGraph.Dependency("a", "b");
            scriptGraph.Dependency("a", "c");
            scriptGraph.Dependency("d", "e");
            scriptGraph.Dependency("d", "b");
            scriptGraph.CompileDependencies(new PackageLog());
            Services.Inject(scriptGraph);
        }
コード例 #9
0
        public void SetUp()
        {
            graph = new ScriptGraph();
            var reader = new ScriptDslReader(graph);

            reader.ReadLine("1 includes A,B,C");
            reader.ReadLine("2 includes C,D");
            reader.ReadLine("3 includes 1,E");
            reader.ReadLine("D requires D1,D2");
            reader.ReadLine("3 requires 4");
            reader.ReadLine("4 includes jquery,validation.js");
            reader.ReadLine("Combo includes 1,2");
            reader.ReadLine("C-1 extends C");
            reader.ReadLine("crud includes crudForm.js,validation.js");
            reader.ReadLine("A requires crud");
            graph.CompileDependencies(new PackageRegistryLog());
        }
コード例 #10
0
        private string SerializeSelectedNodes()
        {
            if (m_selectedNodes.Count <= 0)
            {
                return("");
            }

            List <CNode> nodesToSerialize = new List <CNode>(m_selectedNodes.Count);

            foreach (CScriptNodeViewmodel nodeViewmodel in m_selectedNodes)
            {
                if (nodeViewmodel.ScriptNode.AllowCopy)
                {
                    nodesToSerialize.Add(nodeViewmodel.ScriptNode);
                }
            }

            ScriptGraph.PrepareNodesForCopy(nodesToSerialize);
            return(CScriptSerializer.Instance.Serialize(nodesToSerialize));
        }
コード例 #11
0
 public void SetUp()
 {
     _compiled = false;
     theGraph  = new ScriptGraph();
 }
コード例 #12
0
 public ScriptGraphFixture()
 {
     _graph = new ScriptGraph();
 }
コード例 #13
0
 public ScriptGraphConfigurationActivator(ScriptGraph scripts, IFileSystem fileSystem)
 {
     _scripts = scripts;
     _fileSystem = fileSystem;
 }
コード例 #14
0
 public ScriptIncludeWriter(ScriptGraph scripts, ScriptRequirements requirements, IScriptTagWriter writer)
 {
     _scripts      = scripts;
     _requirements = requirements;
     _writer       = writer;
 }
コード例 #15
0
ファイル: ScriptGraphTester.cs プロジェクト: nieve/fubumvc
 public void SetUp()
 {
     _compiled = false;
     theGraph = new ScriptGraph();
 }
コード例 #16
0
ファイル: ScriptWriter.cs プロジェクト: Jakobsson/fubumvc
 public ScriptWriter(ScriptGraph scripts, IUrlRegistry urls)
 {
     _scripts = scripts;
     _urls = urls;
 }
コード例 #17
0
 public void Configure(FilePool files, ScriptGraph graph)
 {
     _configure(files, graph);
 }
コード例 #18
0
 public override void SetUp(ITestContext context)
 {
     _graph = context.Retrieve<ScriptGraph>();
 }
コード例 #19
0
 public IGrammar SetupScriptGraph()
 {
     return Embed<ScriptGraphSetupFixture>("If the script graph is configured as")
         .Before((step, context) =>
         {
             _graph = new ScriptGraph();
             context.Store(_graph);
         });
 }
コード例 #20
0
 public override void SetUp(ITestContext context)
 {
     _graph = context.Retrieve <ScriptGraph>();
 }
コード例 #21
0
 private Script getScript(ScriptGraph graph, string name)
 {
     return graph.GetScript(name).FirstOrDefault(s => s.Name == name);
 }
コード例 #22
0
 public ScriptWriter(ScriptGraph scripts, IUrlRegistry urls)
 {
     _scripts = scripts;
     _urls    = urls;
 }
コード例 #23
0
ファイル: ScriptSetTester.cs プロジェクト: henninga/fubumvc
 public void SetUp()
 {
     theGraph = new ScriptGraph();
 }
コード例 #24
0
ファイル: ScriptManager.cs プロジェクト: nhsevidence/fubumvc
 public ScriptManager(ScriptGraph graph)
 {
     _graph = graph;
     _includes = new List<string>();
 }
コード例 #25
0
 public ScriptIncludeWriter(ScriptGraph scripts, ScriptRequirements requirements, IScriptTagWriter writer)
 {
     _scripts = scripts;
     _requirements = requirements;
     _writer = writer;
 }
コード例 #26
0
ファイル: ScriptGraphTester.cs プロジェクト: henninga/fubumvc
 public void SetUp()
 {
     graph = new ScriptGraph();
     var reader = new ScriptDslReader(graph);
     reader.ReadLine("1 includes A,B,C");
     reader.ReadLine("2 includes C,D");
     reader.ReadLine("3 includes 1,E");
     reader.ReadLine("D requires D1,D2");
     reader.ReadLine("3 requires 4");
     reader.ReadLine("4 includes jquery,validation.js");
     reader.ReadLine("Combo includes 1,2");
     reader.ReadLine("C-1 extends C");
     reader.ReadLine("crud includes crudForm.js,validation.js");
     reader.ReadLine("A requires crud");
     graph.CompileDependencies(new PackageLog());
 }
コード例 #27
0
 public ScriptGraphFixture()
 {
     _graph = new ScriptGraph();
 }
コード例 #28
0
ファイル: ScriptSetTester.cs プロジェクト: pjdennis/fubumvc
 public void SetUp()
 {
     theGraph = new ScriptGraph();
 }
コード例 #29
0
ファイル: ScriptGatherer.cs プロジェクト: nieve/fubumvc
 public ScriptGatherer(ScriptGraph graph, IEnumerable<string> names)
 {
     _graph = graph;
     _names = names;
 }
コード例 #30
0
 public ScriptRequirements(IContentFolderService folders, ScriptGraph scriptGraph)
 {
     _folders = folders;
     _scriptGraph = scriptGraph;
 }
        public void SetUp()
        {
            Directory.GetFiles(".", "*.script.config").Each(x => File.Delete(x));

            scripts = new ScriptGraph();
            activator = new ScriptGraphConfigurationActivator(scripts, new FileSystem());

            log = new PackageRegistryLog();
        }
コード例 #32
0
 public void BeforeEach()
 {
     _graph = new ScriptGraph();
 }
コード例 #33
0
 public static void Configure(this IEnumerable<IScriptConfigurationAction> actions, FilePool files, ScriptGraph graph)
 {
     actions.Each(action => action.Configure(files, graph));
 }
コード例 #34
0
 public ScriptGraphConfigurationActivator(ScriptGraph scripts, IFileSystem fileSystem)
 {
     _scripts    = scripts;
     _fileSystem = fileSystem;
 }