Пример #1
0
        public void TaskStepProcessor_Processes()
        {
            var yaml = new YamlStream();

            using (TextReader tr = File.OpenText(@"C:\Users\Tim\source\repos\BrowseOmatic\BrowseOmatic\config.yaml"))
                yaml.Load(tr);
            var root = (YamlMappingNode)yaml.Documents[0].RootNode;

            BomTask Task1 = new BomTask()
            {
                BomTaskSteps = new List <BomTaskStep>()
                {
                    new BomTaskStep("ts1"), new BomTaskStep("ts2")
                }
            };
            BomTask Task2 = new BomTask()
            {
                BomTaskSteps = new List <BomTaskStep>()
                {
                    new BomTaskStep("ts11"), new BomTaskStep("ts22")
                }
            };
            BomTask Taska = new BomTask()
            {
                BomTaskSteps = new List <BomTaskStep>()
                {
                    new BomTaskStep("tsa1")
                }
            };
            BomTask Taskb = new BomTask()
            {
                BomTaskSteps = new List <BomTaskStep>()
                {
                    new BomTaskStep("tsb1")
                }
            };

            Task1.BomTasks.Add(Task2);
            var tasks = new List <BomTask>();

            tasks.Add(Task1);
            tasks.Add(Taska);
            tasks.Add(Taskb);

            foreach (var task in tasks)
            {
                ProcessTask(task);
            }
        }
Пример #2
0
 public void ProcessTask(BomTask task)
 {
     ProcessTask(task);
     ProcessTaskStep(task.BomTaskSteps);
 }