From 0832ac460e994d1f852f14e91b09b380ebf66a52 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期二, 30 七月 2024 14:04:12 +0800 Subject: [PATCH] 1 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/04-GeneralProject/GenerateXhsProjectWizardPage.cs | 153 ++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 122 insertions(+), 31 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 a241bb1..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 @@ -1,58 +1,149 @@ -锘縰sing DevExpress.XtraEditors; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace HStation.WinFrmUI +锘縩amespace HStation.WinFrmUI { public partial class GenerateXhsProjectWizardPage : DevExpress.XtraEditors.XtraUserControl, IWizardPage<ImportXhsProjectViewModel> { public GenerateXhsProjectWizardPage() { InitializeComponent(); + this.layoutControl1.SetupLayoutControl(); } - public bool AllowPrev => throw new NotImplementedException(); - - public bool AllowNext => throw new NotImplementedException(); - - public bool AllowCancel => throw new NotImplementedException(); - - public bool AllowComplete => throw new NotImplementedException(); - - public bool IsInitialize => throw new NotImplementedException(); - + /// <summary> + /// 鐘舵�佹敼鍙樹簨浠� + /// </summary> public event Action PageStateChangedEvent; + private bool _isInitialize = false;//鏄惁鍒濆鍖� + private bool _importResult = false;//瀵煎叆缁撴灉 + private ImportXhsProjectViewModel _vm = null;//鎿嶄綔瀵硅薄 - public bool CanCancel() + + /// <summary> + /// + /// </summary> + public async void InitialPage(ImportXhsProjectViewModel vm) { - throw new NotImplementedException(); + _vm = vm; + _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(); } - public bool CanComplete() + /// <summary> + /// 鍏佽涓婁竴姝� + /// </summary> + public bool AllowPrev { - throw new NotImplementedException(); + get + { + if (_isInitialize) + { + if (!_importResult) + { + return true; + } + } + return false; + } } - public bool CanNext() + /// <summary> + /// 鍏佽涓嬩竴姝� + /// </summary> + public bool AllowNext { - throw new NotImplementedException(); + get + { + if (_isInitialize) + { + if (_importResult) + { + return true; + } + } + return false; + } } + /// <summary> + /// 鍏佽鍙栨秷 + /// </summary> + public bool AllowCancel + { + get + { + if (_isInitialize) + { + if (!_importResult) + { + return true; + } + } + return false; + } + } + + /// <summary> + /// 鍏佽瀹屾垚 + /// </summary> + public bool AllowComplete + { + get { return false; } + } + + /// <summary> + /// 鑳藉惁涓婁竴姝� + /// </summary> + /// <returns></returns> public bool CanPrev() { - throw new NotImplementedException(); + return this.AllowPrev; } - public void InitialPage(ImportXhsProjectViewModel t) + /// <summary> + /// 鑳藉惁涓嬩竴姝� + /// </summary> + public bool CanNext() { - throw new NotImplementedException(); + return this.AllowNext; } + + /// <summary> + /// 鑳藉惁鍙栨秷 + /// </summary> + public bool CanCancel() + { + return this.AllowCancel; + } + + /// <summary> + /// 鑳藉惁瀹屾垚 + /// </summary> + public bool CanComplete() + { + return false; + } + + + + + + } } -- Gitblit v1.9.3