Beispiel #1
0
        /// <summary>
        /// Create a complex pipeline, with a root node and two leaf nodes
        /// </summary>
        public static ProjectDOM.Pipeline CreateTreePipeline()
        {
            // create a pipeline
            var pipeline = new ProjectDOM.Pipeline();

            // create root node and set it as root of the pipeline
            var nodeId = pipeline.AddRootNode("TestFilter2");

            // create leaf nodes
            var node2Id = pipeline.AddNode("TestFilter1");
            var node3Id = pipeline.AddNode("TestFilter1");

            // set leaf node properties
            var nodeProps = pipeline.GetNode(node2Id).GetPropertiesForConfiguration("Root");

            nodeProps.SetValue("Value1", "5");
            nodeProps.SetValue("Value2", "7");

            // set leaf node properties
            nodeProps = pipeline.GetNode(node3Id).GetPropertiesForConfiguration("Root");
            nodeProps.SetValue("Value1", "5");
            nodeProps.SetValue("Value2", "7");

            // set root node properties
            nodeProps = pipeline.GetNode(nodeId).GetPropertiesForConfiguration("Root");
            nodeProps.SetReferenceIds("Value1", node2Id);
            nodeProps.SetReferenceIds("Value2", node3Id);

            return(pipeline);
        }
Beispiel #2
0
        public static ProjectDOM.Pipeline CreateArithmeticPipeline()
        {
            // create a pipeline
            var pipeline = new ProjectDOM.Pipeline();

            var value1Id = pipeline.AddNode("AssignIntegerValue");

            pipeline.GetNode(value1Id).GetPropertiesForConfiguration("Root").SetValue("Value", "5");

            var value2Id = pipeline.AddNode("AssignIntegerValue");

            pipeline.GetNode(value2Id).GetPropertiesForConfiguration("Root").SetValue("Value", "5");

            var rootId = pipeline.AddRootNode("AddIntegerValues");

            pipeline.GetNode(rootId).GetPropertiesForConfiguration("Root").SetReferenceIds("Value1", value1Id);
            pipeline.GetNode(rootId).GetPropertiesForConfiguration("Root").SetReferenceIds("Value2", value2Id);

            return(pipeline);
        }
Beispiel #3
0
        /// <summary>
        /// Create a simple pipeline, with a single node that returns the sum of two values
        /// </summary>
        public static ProjectDOM.Pipeline CreateBasicPipeline()
        {
            // create a pipeline
            var pipeline = new ProjectDOM.Pipeline();

            // create a node and set it as root of the pipeline
            var nodeId = pipeline.AddRootNode("TestFilter1");

            // set node properties for "Root" Configuration
            var nodeProps = pipeline.GetNode(nodeId).GetPropertiesForConfiguration("Root");

            nodeProps.SetValue("Value1", "5");
            nodeProps.SetValue("Value2", "7");

            return(pipeline);
        }
Beispiel #4
0
 public ProjectDOM.Node GetNodeDOM(Guid id)
 {
     return(_PipelineDom.GetNode(id));
 }
Beispiel #5
0
        public static IEnumerable <ProjectDOM.Node> GetReferences(this ProjectDOM.Pipeline pipeline, ProjectDOM.Node parent, string jointCfg, string propertyName)
        {
            var ids = parent.GetReferenceIds(jointCfg, propertyName);

            return(ids.Select(item => pipeline.GetNode(item)));
        }
Beispiel #6
0
        public static ProjectDOM.Node CreateRootNode(this ProjectDOM.Pipeline pipeline, string className)
        {
            var id = pipeline.AddRootNode(className);

            return(pipeline.GetNode(id));
        }