From 84eab9425c9fbf27ff50a3bc314966babd1e960c Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 1 Apr 2022 17:39:01 +0300 Subject: [PATCH] Keep ResultBar update 5 seconds long. Turn off save as dialog after tools complete. --- src/Interface/AbstractBar.cs | 11 +++++++++-- src/Interface/ResultBar.cs | 4 +++- src/PriceListTools/CombineTool.cs | 3 --- src/PriceListTools/ConvertTool.cs | 3 --- src/PriceListTools/ExportTool.cs | 3 --- src/PriceListTools/MergeTool.cs | 3 --- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Interface/AbstractBar.cs b/src/Interface/AbstractBar.cs index c5918a8..84ece24 100644 --- a/src/Interface/AbstractBar.cs +++ b/src/Interface/AbstractBar.cs @@ -1,11 +1,18 @@ -using Microsoft.Office.Interop.Excel; +using ExcelDna.Integration; +using Microsoft.Office.Interop.Excel; namespace RehauSku.Interface { - internal abstract class AbstractBar + internal abstract class AbstractBar { protected Application Excel = AddIn.Excel; public abstract void Update(); + + [ExcelFunction] + public static void ResetStatusBar() + { + AddIn.Excel.StatusBar = false; + } } } diff --git a/src/Interface/ResultBar.cs b/src/Interface/ResultBar.cs index 1b4d7f4..55bc235 100644 --- a/src/Interface/ResultBar.cs +++ b/src/Interface/ResultBar.cs @@ -1,4 +1,5 @@ -using System.Text; +using System; +using System.Text; namespace RehauSku.Interface { @@ -39,6 +40,7 @@ namespace RehauSku.Interface } Excel.StatusBar = sb.ToString(); + AddIn.Excel.OnTime(DateTime.Now + new TimeSpan(0, 0, 5), "ResetStatusBar"); } } } diff --git a/src/PriceListTools/CombineTool.cs b/src/PriceListTools/CombineTool.cs index eddf9e7..5a4d128 100644 --- a/src/PriceListTools/CombineTool.cs +++ b/src/PriceListTools/CombineTool.cs @@ -50,9 +50,6 @@ namespace RehauSku.PriceListTools FilterByAmount(); ResultBar.Update(); - - Interface.Dialog.SaveWorkbookAs(); - ExcelApp.StatusBar = false; } } } diff --git a/src/PriceListTools/ConvertTool.cs b/src/PriceListTools/ConvertTool.cs index 1bb02f4..3a7da20 100644 --- a/src/PriceListTools/ConvertTool.cs +++ b/src/PriceListTools/ConvertTool.cs @@ -24,9 +24,6 @@ namespace RehauSku.PriceListTools FilterByAmount(); ResultBar.Update(); - - Dialog.SaveWorkbookAs(); - ExcelApp.StatusBar = false; } } } \ No newline at end of file diff --git a/src/PriceListTools/ExportTool.cs b/src/PriceListTools/ExportTool.cs index 603de8b..a5457c0 100644 --- a/src/PriceListTools/ExportTool.cs +++ b/src/PriceListTools/ExportTool.cs @@ -34,9 +34,6 @@ namespace RehauSku.PriceListTools FilterByAmount(); ResultBar.Update(); - - Interface.Dialog.SaveWorkbookAs(); - ExcelApp.StatusBar = false; } private void GetSelected() diff --git a/src/PriceListTools/MergeTool.cs b/src/PriceListTools/MergeTool.cs index 179fb81..f55601f 100644 --- a/src/PriceListTools/MergeTool.cs +++ b/src/PriceListTools/MergeTool.cs @@ -40,9 +40,6 @@ namespace RehauSku.PriceListTools FilterByAmount(); ResultBar.Update(); - - Dialog.SaveWorkbookAs(); - ExcelApp.StatusBar = false; } } }