| | |
| | | /// </summary> |
| | | public event Action PageStateChangedEvent; |
| | | private bool _isInitialize = false;//是否初始化 |
| | | private bool _importResult = false;//导入结果 |
| | | private ImportXhsProjectViewModel _vm = null;//操作对象 |
| | | |
| | | |
| | |
| | | /// </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(); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public bool AllowPrev |
| | | { |
| | | get { return false; } |
| | | get |
| | | { |
| | | if (_isInitialize) |
| | | { |
| | | if (!_importResult) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public bool AllowNext |
| | | { |
| | | get { return _isInitialize; } |
| | | get |
| | | { |
| | | if (_isInitialize) |
| | | { |
| | | if (_importResult) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public bool AllowCancel |
| | | { |
| | | get { return false; } |
| | | get |
| | | { |
| | | if (_isInitialize) |
| | | { |
| | | if (!_importResult) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public bool CanPrev() |
| | | { |
| | | return false; |
| | | return this.AllowPrev; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public bool CanNext() |
| | | { |
| | | return _isInitialize; |
| | | return this.AllowNext; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public bool CanCancel() |
| | | { |
| | | return false; |
| | | return this.AllowCancel; |
| | | } |
| | | |
| | | /// <summary> |