2022-02-05 12:59:16 +03:00
|
|
|
|
using Microsoft.Office.Interop.Excel;
|
|
|
|
|
|
2022-12-19 20:25:35 +03:00
|
|
|
|
namespace RhSolutions
|
2022-02-05 12:59:16 +03:00
|
|
|
|
{
|
|
|
|
|
internal static class EventsUtil
|
|
|
|
|
{
|
2022-02-12 16:53:34 +03:00
|
|
|
|
private static readonly Application Excel = AddIn.Excel;
|
2022-02-05 12:59:16 +03:00
|
|
|
|
|
|
|
|
|
public static void Initialize()
|
|
|
|
|
{
|
|
|
|
|
Excel.SheetSelectionChange += RefreshExportButton;
|
|
|
|
|
Excel.SheetActivate += RefreshConvertButton;
|
|
|
|
|
Excel.WorkbookActivate += RefreshConvertButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Uninitialize()
|
|
|
|
|
{
|
|
|
|
|
Excel.SheetSelectionChange -= RefreshExportButton;
|
|
|
|
|
Excel.SheetActivate -= RefreshConvertButton;
|
|
|
|
|
Excel.WorkbookActivate -= RefreshConvertButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void RefreshConvertButton(object sh)
|
|
|
|
|
{
|
2022-02-14 10:34:26 +03:00
|
|
|
|
Interface.RibbonController.RefreshControl("convert");
|
2022-02-05 12:59:16 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void RefreshExportButton(object sh, Range target)
|
|
|
|
|
{
|
2022-02-14 10:34:26 +03:00
|
|
|
|
Interface.RibbonController.RefreshControl("export");
|
2022-02-05 12:59:16 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|