From 40213047b1cee48144c5a1eee1778ada6f609ca1 Mon Sep 17 00:00:00 2001
From: chr <chrry550@163.com>
Date: 星期四, 07 三月 2024 16:06:08 +0800
Subject: [PATCH] 优化InnerWindow的Resize;

---
 Models/Program.cs |   43 ++++++++++++++++++++++++++++---------------
 1 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/Models/Program.cs b/Models/Program.cs
index 9e0f86c..c92cc56 100644
--- a/Models/Program.cs
+++ b/Models/Program.cs
@@ -4,6 +4,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Xml.Serialization;
 
 namespace WPFProject.Models
 {
@@ -20,6 +21,16 @@
         }
 
         /// <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;
@@ -30,34 +41,36 @@
         }
 
         /// <summary>
-        /// 搴忓垪闆嗗悎
+        /// 鍒濆鍙傛暟鍙傛暟
         /// </summary>
-        private ObservableCollection<Sequence> _Sequences;
-        public ObservableCollection<Sequence> Sequences
+        private Dictionary<string, Variable> _InitVars;
+        [XmlIgnore]
+        public Dictionary<string, Variable> InitVars
         {
-            get { return _Sequences; }
-            set => RaiseAndSetIfChanged(ref _Sequences, value);
-        }
-
-        /// <summary>
-        /// 鎵�闇�鍙傛暟
-        /// </summary>
-        private Dictionary<string, Variable> _Vars;
-        public Dictionary<string, Variable> Vars
-        {
-            get { return _Vars; }
-            set { _Vars = value; }
+            get { return _InitVars; }
+            set { _InitVars = value; }
         }
 
         /// <summary>
         /// 璁$畻涓存椂鍙傛暟
         /// </summary>
         private Dictionary<string, Variable> _TempVars;
+        [XmlIgnore]
         public Dictionary<string, Variable> 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;
+        }
     }
 }

--
Gitblit v1.9.1