RhSolutions-AddIn/src/Models/StatusbarBase.cs

27 lines
603 B
C#
Raw Normal View History

using ExcelDna.Integration;
using Microsoft.Office.Interop.Excel;
2022-12-20 12:41:46 +03:00
using RhSolutions.AddIn;
2022-04-01 17:55:36 +03:00
using System;
2022-12-20 08:31:38 +03:00
using System.Threading;
using System.Threading.Tasks;
2022-02-04 09:17:12 +03:00
2022-12-20 12:27:47 +03:00
namespace RhSolutions.Models
2022-02-04 09:17:12 +03:00
{
2022-12-20 11:53:55 +03:00
internal abstract class StatusbarBase : IDisposable
2022-02-04 09:17:12 +03:00
{
2022-12-20 12:27:47 +03:00
protected Application Excel = RhSolutionsAddIn.Excel;
2022-02-04 09:17:12 +03:00
public abstract void Update();
2022-12-20 08:31:38 +03:00
private static void ResetStatusBar()
{
2022-12-20 12:27:47 +03:00
RhSolutionsAddIn.Excel.StatusBar = false;
}
2022-04-01 17:55:36 +03:00
public void Dispose()
{
2022-12-20 08:31:38 +03:00
Task.Delay(5000).ContinueWith(t => ResetStatusBar());
2022-04-01 17:55:36 +03:00
}
2022-02-04 09:17:12 +03:00
}
}