using System.Collections.Generic; using System.Collections.ObjectModel; using System.Xml.Serialization; using VisionBuilder.Core.Api; namespace WPFProject.Models { public class Sequence : NotifyBase { private string _Name; public string Name { get { return _Name; } set => RaiseAndSetIfChanged(ref _Name, value); } [XmlIgnore] public Program Program { get; set; } private ObservableCollection _Steps = new ObservableCollection(); public ObservableCollection Steps { get { return _Steps; } set => RaiseAndSetIfChanged(ref _Steps, value); } public Sequence AddStep(params Step[] steps) { foreach (Step step in steps) { if (step == null) continue; step.Sequence = this; Steps.Add(step); } return this; } public void RunSequnce() { foreach (Step step in Steps) { step.RunStep(); } } public Sequence() { AddStep(new Step { Name = "000" }, new Step { Name = "111" }); } } }