From 5f2fed99394f95c133d330349ddf367b669951e9 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期二, 23 七月 2024 15:52:33 +0800
Subject: [PATCH] 项目导入调试修改

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/04-GeneralProject/GenerateXhsProjectWizardPage.cs |   54 ++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/04-GeneralProject/GenerateXhsProjectWizardPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/04-GeneralProject/GenerateXhsProjectWizardPage.cs
index 325cb00..0cac22f 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/04-GeneralProject/GenerateXhsProjectWizardPage.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/04-GeneralProject/GenerateXhsProjectWizardPage.cs
@@ -13,6 +13,7 @@
         /// </summary>
         public event Action PageStateChangedEvent;
         private bool _isInitialize = false;//鏄惁鍒濆鍖�
+        private bool _importResult = false;//瀵煎叆缁撴灉
         private ImportXhsProjectViewModel _vm = null;//鎿嶄綔瀵硅薄
 
 
@@ -21,22 +22,21 @@
         /// </summary>
         public async void InitialPage(ImportXhsProjectViewModel vm)
         {
-            if (_isInitialize)
-            {
-                return;
-            }
             _vm = vm;
-            _isInitialize = await ImportXhsProjectHelper.Import(vm, (msg) =>
+            _isInitialize = false;
+            _importResult = false;
+            _importResult = await ImportXhsProjectHelper.Import(vm, (msg) =>
              {
                  this.listBoxControl1.Items.Add(msg);
              }, (max, current) =>
              {
                  this.progressBarControl1.Properties.Maximum = max;
                  this.progressBarControl1.Position = current;
+                 //鏇夸唬鏂规
                  // this.progressBarControl1.Properties.Step = current;
                  // this.progressBarControl1.PerformStep();
              });
-
+            _isInitialize = true;
             this.PageStateChangedEvent?.Invoke();
         }
 
@@ -45,7 +45,17 @@
         /// </summary>
         public bool AllowPrev
         {
-            get { return false; }
+            get
+            {
+                if (_isInitialize)
+                {
+                    if (!_importResult)
+                    {
+                        return true;
+                    }
+                }
+                return false;
+            }
         }
 
         /// <summary>
@@ -53,7 +63,17 @@
         /// </summary>
         public bool AllowNext
         {
-            get { return _isInitialize; }
+            get
+            {
+                if (_isInitialize)
+                {
+                    if (_importResult)
+                    {
+                        return true;
+                    }
+                }
+                return false;
+            }
         }
 
         /// <summary>
@@ -61,7 +81,17 @@
         /// </summary>
         public bool AllowCancel
         {
-            get { return false; }
+            get
+            {
+                if (_isInitialize)
+                {
+                    if (!_importResult)
+                    {
+                        return true;
+                    }
+                }
+                return false;
+            }
         }
 
         /// <summary>
@@ -78,7 +108,7 @@
         /// <returns></returns>
         public bool CanPrev()
         {
-            return false;
+            return this.AllowPrev;
         }
 
         /// <summary>
@@ -86,7 +116,7 @@
         /// </summary>
         public bool CanNext()
         {
-            return _isInitialize;
+            return this.AllowNext;
         }
 
         /// <summary>
@@ -94,7 +124,7 @@
         /// </summary>
         public bool CanCancel()
         {
-            return false;
+            return this.AllowCancel;
         }
 
         /// <summary>

--
Gitblit v1.9.3