Turn off save as file dialog at the end of tool process. Version update.
This commit is contained in:
parent
68d2b4e2fb
commit
eaf3ebaa94
@ -36,22 +36,5 @@ namespace RehauSku.Interface
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SaveWorkbookAs()
|
||||
{
|
||||
Workbook workbook = AddIn.Excel.ActiveWorkbook;
|
||||
|
||||
using (SaveFileDialog dialog = new SaveFileDialog())
|
||||
{
|
||||
dialog.FileName = workbook.Name;
|
||||
dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm";
|
||||
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string fileName = dialog.FileName;
|
||||
workbook.SaveAs(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RehauSku.Interface;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RehauSku.PriceListTools
|
||||
{
|
||||
@ -21,7 +22,7 @@ namespace RehauSku.PriceListTools
|
||||
}
|
||||
}
|
||||
|
||||
public override void FillTarget()
|
||||
public override async void FillTarget()
|
||||
{
|
||||
ProgressBar = new ProgressBar("Заполняю строки...", PositionAmount.Count);
|
||||
ResultBar = new ResultBar();
|
||||
@ -35,7 +36,7 @@ namespace RehauSku.PriceListTools
|
||||
FilterByAmount();
|
||||
ResultBar.Update();
|
||||
|
||||
Interface.Dialog.SaveWorkbookAs();
|
||||
await Task.Delay(new TimeSpan(0, 0, 5));
|
||||
ExcelApp.StatusBar = false;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.4.1")]
|
||||
[assembly: AssemblyFileVersion("1.0.4.1")]
|
||||
[assembly: AssemblyVersion("1.0.4.2")]
|
||||
[assembly: AssemblyFileVersion("1.0.4.2")]
|
||||
|
Loading…
Reference in New Issue
Block a user