getLabel implemetation for pricelist button
This commit is contained in:
parent
7144be9b9c
commit
070733036b
@ -63,9 +63,15 @@ namespace RehauSku
|
|||||||
{
|
{
|
||||||
priceListPath = value;
|
priceListPath = value;
|
||||||
RootKey.SetValue("PriceListPath", value);
|
RootKey.SetValue("PriceListPath", value);
|
||||||
|
RibbonController.RefreshControl("setPriceList");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetPriceListName()
|
||||||
|
{
|
||||||
|
return Path.GetFileName(priceListPath);
|
||||||
|
}
|
||||||
|
|
||||||
public static ResponseOrder StoreResponseOrder
|
public static ResponseOrder StoreResponseOrder
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
using Microsoft.Office.Interop.Excel;
|
using Microsoft.Office.Interop.Excel;
|
||||||
using RehauSku.PriceListTools;
|
using RehauSku.PriceListTools;
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@ -27,8 +29,8 @@ namespace RehauSku.Interface
|
|||||||
<button id='combine' label='По колонкам' onAction='OnToolPressed'/>
|
<button id='combine' label='По колонкам' onAction='OnToolPressed'/>
|
||||||
</menu>
|
</menu>
|
||||||
</group>
|
</group>
|
||||||
<group id='rausettings' label='Настройки'>
|
<group id='rausettings' getLabel='GetVersionLabel'>
|
||||||
<button id='setPriceList' label='Указать путь к шаблону' size='large' imageMso='CurrentViewSettings' onAction='OnSetPricePressed'/>
|
<button id='setPriceList' getLabel='GetPriceListPathLabel' size='large' imageMso='TableExcelSpreadsheetInsert' onAction='OnSetPricePressed'/>
|
||||||
</group>
|
</group>
|
||||||
</tab>
|
</tab>
|
||||||
</tabs>
|
</tabs>
|
||||||
@ -118,5 +120,17 @@ namespace RehauSku.Interface
|
|||||||
return selection.Columns.Count == 2;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user