lixiaojun
2024-07-24 61f13137f1a7f1b0410fc6666ceeee0f04576943
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>