diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2022-02-14 11:06:40 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2022-02-14 11:06:40 +0300 |
commit | 070733036b67e1b11132503d68a5e5d361cacc18 (patch) | |
tree | 2aed4d8855d972fa204e684d6a65eed0c231a091 /src/Interface | |
parent | 7144be9b9cae5fed0fcfde2e37512ab4397c6763 (diff) |
getLabel implemetation for pricelist button
Diffstat (limited to 'src/Interface')
-rw-r--r-- | src/Interface/RibbonController.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Interface/RibbonController.cs b/src/Interface/RibbonController.cs index bd50550..7bf9ee1 100644 --- a/src/Interface/RibbonController.cs +++ b/src/Interface/RibbonController.cs @@ -2,6 +2,8 @@ using Microsoft.Office.Interop.Excel; using RehauSku.PriceListTools; using System; +using System.IO; +using System.Reflection; using System.Runtime.InteropServices; using System.Windows.Forms; @@ -27,8 +29,8 @@ namespace RehauSku.Interface <button id='combine' label='По колонкам' onAction='OnToolPressed'/> </menu> </group> - <group id='rausettings' label='Настройки'> - <button id='setPriceList' label='Указать путь к шаблону' size='large' imageMso='CurrentViewSettings' onAction='OnSetPricePressed'/> + <group id='rausettings' getLabel='GetVersionLabel'> + <button id='setPriceList' getLabel='GetPriceListPathLabel' size='large' imageMso='TableExcelSpreadsheetInsert' onAction='OnSetPricePressed'/> </group> </tab> </tabs> @@ -118,5 +120,17 @@ namespace RehauSku.Interface return selection.Columns.Count == 2; } } + + public string GetVersionLabel(IRibbonControl control) + { + string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + return $"v{version}"; + } + + public string GetPriceListPathLabel(IRibbonControl control) + { + string name = RegistryUtil.GetPriceListName(); + return string.IsNullOrEmpty(name) ? "Нет файла шаблона!" : name; + } } } |