using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; namespace WPFProject.Models { public class Program : NotifyBase { /// /// 程序名 /// private string _Name; public string Name { get { return _Name; } set => RaiseAndSetIfChanged(ref _Name, value); } /// /// 序列集合 /// private ObservableCollection _Sequences = new ObservableCollection(); public ObservableCollection Sequences { get { return _Sequences; } set => RaiseAndSetIfChanged(ref _Sequences, value); } /// /// 程序所需参数 /// private ObservableCollection _Variables; public ObservableCollection Variables { get { return _Variables; } set => RaiseAndSetIfChanged(ref _Variables, value); } /// /// 初始参数参数 /// private Dictionary _InitVars; [XmlIgnore] public Dictionary InitVars { get { return _InitVars; } set { _InitVars = value; } } /// /// 计算临时参数 /// private Dictionary _TempVars; [XmlIgnore] public Dictionary TempVars { get { return _TempVars; } set { _TempVars = value; } } public Program AddSequnce(params Sequence[] sequences) { foreach (Sequence sequence in sequences) { if (sequence == null) continue; sequence.Program = this; Sequences.Add(sequence); } return this; } } }