From f45bba0b5ecf73df67af6cb60e57ea956d82a8ab Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期二, 30 七月 2024 14:36:10 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/04-GeneralProject/GenerateXhsProjectWizardPage.cs | 59 +++++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 47 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..cadf451 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,26 @@ /// </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(); }); - + if (!_importResult) + { + this.progressBarControl1.Position = 0; + this.itemForProgress.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; + } + _isInitialize = true; this.PageStateChangedEvent?.Invoke(); } @@ -45,7 +50,17 @@ /// </summary> public bool AllowPrev { - get { return false; } + get + { + if (_isInitialize) + { + if (!_importResult) + { + return true; + } + } + return false; + } } /// <summary> @@ -53,7 +68,17 @@ /// </summary> public bool AllowNext { - get { return _isInitialize; } + get + { + if (_isInitialize) + { + if (_importResult) + { + return true; + } + } + return false; + } } /// <summary> @@ -61,7 +86,17 @@ /// </summary> public bool AllowCancel { - get { return false; } + get + { + if (_isInitialize) + { + if (!_importResult) + { + return true; + } + } + return false; + } } /// <summary> @@ -78,7 +113,7 @@ /// <returns></returns> public bool CanPrev() { - return false; + return this.AllowPrev; } /// <summary> @@ -86,7 +121,7 @@ /// </summary> public bool CanNext() { - return _isInitialize; + return this.AllowNext; } /// <summary> @@ -94,7 +129,7 @@ /// </summary> public bool CanCancel() { - return false; + return this.AllowCancel; } /// <summary> -- Gitblit v1.9.3