Browse Source

修复bug460和444:recipe步次使用其他步override对象造成的引用bug

huangping 1 month ago
parent
commit
f1ee6253ec
1 changed files with 14 additions and 12 deletions
  1. 14 12
      FrameworkLocal/UIClient/CenterViews/Editors/Recipe/RecipeDataBase.cs

+ 14 - 12
FrameworkLocal/UIClient/CenterViews/Editors/Recipe/RecipeDataBase.cs

@@ -320,19 +320,21 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
         public void ShallowCopyStep(ref Step destinationStep, Step originalStep)
         {
             int stepNo = destinationStep.StepNo;
-            Type type = originalStep.GetType();
-            PropertyInfo[] properties = type.GetProperties();
-            // 遍历属性并赋值
-            foreach (PropertyInfo property in properties)
-            {
-                // 判断属性是否可写
-                if (property.CanWrite)
-                {
-                    // 设置属性的值
-                    property.SetValue(destinationStep, property.GetValue(originalStep));
-                }
-            }
+            //Type type = originalStep.GetType();
+            //PropertyInfo[] properties = type.GetProperties();
+            //// 遍历属性并赋值
+            //foreach (PropertyInfo property in properties)
+            //{
+            //    // 判断属性是否可写
+            //    if (property.CanWrite)
+            //    {
+            //        // 设置属性的值
+            //        property.SetValue(destinationStep, property.GetValue(originalStep));
+            //    }
+            //}
+            originalStep.Adapt(destinationStep);
             destinationStep.StepNo = stepNo;
+            SetDelegateEvent(destinationStep);
         }
         public void CloneStep(ref Step destinationStep, Step originalStep)
         {