From 25dd2203bb3b995d73c43733b3aaa049ec28b4a9 Mon Sep 17 00:00:00 2001
From: chr <chrry550@163.com>
Date: 星期二, 12 三月 2024 09:42:43 +0800
Subject: [PATCH] 初版Step运行代码;
---
Models/Program.cs | 114 ++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 85 insertions(+), 29 deletions(-)
diff --git a/Models/Program.cs b/Models/Program.cs
index e73900f..c292bad 100644
--- a/Models/Program.cs
+++ b/Models/Program.cs
@@ -1,29 +1,85 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace WPFProject.Models
-{
- public class Program : NotifyBase
- {
- private string _Name;
-
- public string Name
- {
- get { return _Name; }
- set => RaiseAndSetIfChanged(ref _Name, value);
- }
-
- private ObservableCollection<Sequence> _Sequences;
- public ObservableCollection<Sequence> Sequences
- {
- get { return _Sequences; }
- set => RaiseAndSetIfChanged(ref _Sequences, value);
- }
-
-
- }
-}
+锘縰sing System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Serialization;
+using VisionBuilder.Core.Entity;
+
+namespace WPFProject.Models
+{
+ public class Program : NotifyBase
+ {
+ /// <summary>
+ /// 绋嬪簭鍚�
+ /// </summary>
+ private string _Name;
+ public string Name
+ {
+ get { return _Name; }
+ set => RaiseAndSetIfChanged(ref _Name, value);
+ }
+
+ /// <summary>
+ /// 搴忓垪闆嗗悎
+ /// </summary>
+ private ObservableCollection<Sequence> _Sequences = new ObservableCollection<Sequence>();
+ public ObservableCollection<Sequence> Sequences
+ {
+ get { return _Sequences; }
+ set => RaiseAndSetIfChanged(ref _Sequences, value);
+ }
+
+ /// <summary>
+ /// 绋嬪簭鎵�闇�鍙傛暟
+ /// </summary>
+ private ObservableCollection<Variable> _Variables;
+ public ObservableCollection<Variable> Variables
+ {
+ get { return _Variables; }
+ set => RaiseAndSetIfChanged(ref _Variables, value);
+ }
+
+ /// <summary>
+ /// 鍒濆鍙傛暟鍙傛暟
+ /// </summary>
+ private Dictionary<string, Variable> _InitVars;
+ [XmlIgnore]
+ public Dictionary<string, Variable> InitVars
+ {
+ get { return _InitVars; }
+ set { _InitVars = value; }
+ }
+
+ /// <summary>
+ /// 璁$畻涓存椂鍙傛暟
+ /// </summary>
+ private Dictionary<string, Param> _TempVars;
+ [XmlIgnore]
+ public Dictionary<string, Param> 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;
+ }
+
+ public void Run()
+ {
+ foreach (Sequence sequence in Sequences)
+ {
+ sequence.Run();
+ }
+ }
+ }
+}
--
Gitblit v1.9.1