From 375b488be2666cd56e70728624f4eadaefee0440 Mon Sep 17 00:00:00 2001
From: chenghaoran <chenghaoran@ipilotwhale.com>
Date: 星期二, 12 三月 2024 17:36:49 +0800
Subject: [PATCH] 优化项目结构;
---
WPFProject/Models/Program.cs | 168 +++++++++++++++++++++++++++----------------------------
1 files changed, 83 insertions(+), 85 deletions(-)
diff --git a/Models/Program.cs b/WPFProject/Models/Program.cs
similarity index 89%
rename from Models/Program.cs
rename to WPFProject/Models/Program.cs
index c292bad..2d42db7 100644
--- a/Models/Program.cs
+++ b/WPFProject/Models/Program.cs
@@ -1,85 +1,83 @@
-锘縰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();
- }
- }
- }
-}
+锘縰sing System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Xml.Serialization;
+using VisionBuilder.Core.Api;
+using VisionBuilder.Core.Entity;
+
+namespace WPFProject.Models
+{
+ public class Program : NotifyBase, IProgram
+ {
+ /// <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 = new Dictionary<string, Param>();
+ [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 RunProgram()
+ {
+ foreach (Sequence sequence in Sequences)
+ {
+ sequence.RunSequnce();
+ }
+ }
+ }
+}
--
Gitblit v1.9.1