diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2022-03-24 06:59:31 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2022-03-24 06:59:31 +0300 |
commit | eaf3ebaa9489462e3d663c93df7a9bc34011464c (patch) | |
tree | 57353886c323aa86d43d8770f486e362be087593 /src/PriceListTools | |
parent | 68d2b4e2fb8a3e7903d63f6bc461307e746bf163 (diff) |
Turn off save as file dialog at the end of tool process. Version update.
Diffstat (limited to 'src/PriceListTools')
-rw-r--r-- | src/PriceListTools/CombineTool.cs | 5 | ||||
-rw-r--r-- | src/PriceListTools/ConvertTool.cs | 6 | ||||
-rw-r--r-- | src/PriceListTools/ExportTool.cs | 9 | ||||
-rw-r--r-- | src/PriceListTools/MergeTool.cs | 5 |
4 files changed, 15 insertions, 10 deletions
diff --git a/src/PriceListTools/CombineTool.cs b/src/PriceListTools/CombineTool.cs index eddf9e7..26a2832 100644 --- a/src/PriceListTools/CombineTool.cs +++ b/src/PriceListTools/CombineTool.cs @@ -3,6 +3,7 @@ using RehauSku.Interface; using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Dialog = RehauSku.Interface.Dialog; namespace RehauSku.PriceListTools @@ -26,7 +27,7 @@ namespace RehauSku.PriceListTools } } - public override void FillTarget() + public override async void FillTarget() { ProgressBar = new ProgressBar("Заполняю строки...", SourceFiles.Sum(file => file.PositionAmount.Count)); ResultBar = new ResultBar(); @@ -51,7 +52,7 @@ namespace RehauSku.PriceListTools FilterByAmount(); ResultBar.Update(); - Interface.Dialog.SaveWorkbookAs(); + await Task.Delay(new TimeSpan(0, 0, 5)); ExcelApp.StatusBar = false; } } diff --git a/src/PriceListTools/ConvertTool.cs b/src/PriceListTools/ConvertTool.cs index 1bb02f4..dde969c 100644 --- a/src/PriceListTools/ConvertTool.cs +++ b/src/PriceListTools/ConvertTool.cs @@ -1,4 +1,6 @@ using RehauSku.Interface; +using System; +using System.Threading.Tasks; namespace RehauSku.PriceListTools { @@ -11,7 +13,7 @@ namespace RehauSku.PriceListTools Current = new SourcePriceList(ExcelApp.ActiveWorkbook); } - public override void FillTarget() + public override async void FillTarget() { ProgressBar = new ProgressBar("Заполняю строки...", Current.PositionAmount.Count); ResultBar = new ResultBar(); @@ -25,7 +27,7 @@ namespace RehauSku.PriceListTools FilterByAmount(); ResultBar.Update(); - Dialog.SaveWorkbookAs(); + await Task.Delay(new TimeSpan(0, 0, 5)); ExcelApp.StatusBar = false; } } diff --git a/src/PriceListTools/ExportTool.cs b/src/PriceListTools/ExportTool.cs index 603de8b..6f910b7 100644 --- a/src/PriceListTools/ExportTool.cs +++ b/src/PriceListTools/ExportTool.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using RehauSku.Interface; +using System.Threading.Tasks; namespace RehauSku.PriceListTools { @@ -21,11 +22,11 @@ namespace RehauSku.PriceListTools } } - public override void FillTarget() + public override async void FillTarget() { ProgressBar = new ProgressBar("Заполняю строки...", PositionAmount.Count); ResultBar = new ResultBar(); - + foreach (var kvp in PositionAmount) { FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column); @@ -35,13 +36,13 @@ namespace RehauSku.PriceListTools FilterByAmount(); ResultBar.Update(); - Interface.Dialog.SaveWorkbookAs(); + await Task.Delay(new TimeSpan(0, 0, 5)); ExcelApp.StatusBar = false; } private void GetSelected() { - object[,] cells = Selection.Value2; + object[,] cells = Selection.Value2; PositionAmount = new Dictionary<Position, double>(); int rowsCount = Selection.Rows.Count; diff --git a/src/PriceListTools/MergeTool.cs b/src/PriceListTools/MergeTool.cs index 179fb81..1eb1d54 100644 --- a/src/PriceListTools/MergeTool.cs +++ b/src/PriceListTools/MergeTool.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; namespace RehauSku.PriceListTools { @@ -24,7 +25,7 @@ namespace RehauSku.PriceListTools } } - public override void FillTarget() + public override async void FillTarget() { ProgressBar = new ProgressBar("Заполняю строки...", SourceFiles.Sum(x => x.PositionAmount.Count)); ResultBar = new ResultBar(); @@ -41,7 +42,7 @@ namespace RehauSku.PriceListTools FilterByAmount(); ResultBar.Update(); - Dialog.SaveWorkbookAs(); + await Task.Delay(new TimeSpan(0, 0, 5)); ExcelApp.StatusBar = false; } } |