diff options
Diffstat (limited to 'Source/Ribbon')
-rw-r--r-- | Source/Ribbon/RibbonController.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Source/Ribbon/RibbonController.cs b/Source/Ribbon/RibbonController.cs new file mode 100644 index 0000000..c4ca6d7 --- /dev/null +++ b/Source/Ribbon/RibbonController.cs @@ -0,0 +1,45 @@ +using System.Runtime.InteropServices; +using System.Windows.Forms; +using ExcelDna.Integration.CustomUI; +using RehauSku.Assist; + +namespace Ribbon +{ + [ComVisible(true)] + public class RibbonController : ExcelRibbon + { + public override string GetCustomUI(string RibbonID) + { + return @" + <customUI xmlns='http://schemas.microsoft.com/office/2006/01/customui'> + <ribbon> + <tabs> + <tab id='tab1' label='REHAU'> + <group id='group1' label='Прайс-лист'> + <button id='button1' label='Экспорт' onAction='OnButtonPressed'/> + </group > + </tab> + </tabs> + </ribbon> + </customUI>"; + } + + public void OnButtonPressed(IRibbonControl control) + { + using (DataWriter dw = new DataWriter()) + { + if (!dw.IsRangeValid()) + { + MessageBox.Show("Выделен неверный диапазон!", "Неверный диапазон", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + + else + { + dw.FillSkuAmountDict(); + //dw.FillPriceList(); + } + } + } + } +} |