aboutsummaryrefslogtreecommitdiff
path: root/src/Ribbon
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2022-02-02 09:46:47 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2022-02-02 09:46:47 +0300
commit06799119fb83cb6b75721c5cf60f4051e50976a7 (patch)
treebb25db1abb672764f2a25a10e81bcc23579eaea3 /src/Ribbon
parent7e5020ec253df1d0d32304ba72cdaa62937bb26b (diff)
Add Interface namespace
Diffstat (limited to 'src/Ribbon')
-rw-r--r--src/Ribbon/RibbonController.cs98
1 files changed, 0 insertions, 98 deletions
diff --git a/src/Ribbon/RibbonController.cs b/src/Ribbon/RibbonController.cs
deleted file mode 100644
index 7a514bd..0000000
--- a/src/Ribbon/RibbonController.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using ExcelDna.Integration.CustomUI;
-using RehauSku.Forms;
-using RehauSku.PriceListTools;
-using System;
-using System.Runtime.InteropServices;
-using System.Windows.Forms;
-
-namespace RehauSku.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='rau' label='REHAU'>
- <group id='priceList' label='Прайс-лист'>
- <button id='exportToPrice' label='Экспорт в новый файл' size='normal' imageMso='PivotExportToExcel' onAction='OnExportPressed'/>
- <button id='convertPrice' label='Актуализировать' size='normal' imageMso='FileUpdate' onAction='OnConvertPressed'/>
- <menu id='conjoinMenu' label='Объединить' imageMso='Copy'>
- <button id='mergeFiles' label='Сложить' onAction='OnMergePressed'/>
- <button id='combineFiles' label='По колонкам' onAction='OnCombinePressed'/>
- </menu>
- </group>
- <group id='rausettings' label='Настройки'>
- <button id='setPriceList' label='Указать путь к шаблону' size='large' imageMso='CurrentViewSettings' onAction='OnSetPricePressed'/>
- </group>
- </tab>
- </tabs>
- </ribbon>
- </customUI>";
- }
-
- public void OnMergePressed(IRibbonControl control)
- {
- MergeTool mergeTool = new MergeTool();
- string[] files = Dialog.GetMultiplyFiles();
-
- if (files.Length != 0)
- {
- mergeTool.SourceFiles = Source.GetSourceLists(files);
- mergeTool.OpenNewPrice();
- mergeTool.FillTarget();
- }
- }
-
- public void OnCombinePressed(IRibbonControl control)
- {
- CombineTool combineTool = new CombineTool();
- string[] files = Dialog.GetMultiplyFiles();
-
- if (files.Length != 0)
- {
- combineTool.SourceFiles = Source.GetSourceLists(files);
- combineTool.OpenNewPrice();
- combineTool.FillTarget();
- }
- }
-
- public void OnExportPressed(IRibbonControl control)
- {
- try
- {
- ExportTool exportTool = new ExportTool();
- exportTool.TryGetSelection();
- exportTool.OpenNewPrice();
- exportTool.FillTarget();
- }
-
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message,
- "Ошибка",
- MessageBoxButtons.OK,
- MessageBoxIcon.Information);
- return;
- }
- }
-
- public void OnConvertPressed(IRibbonControl control)
- {
- ConvertTool convertTool = new ConvertTool();
-
- convertTool.GetCurrent();
- convertTool.OpenNewPrice();
- convertTool.FillTarget();
- }
-
- public void OnSetPricePressed(IRibbonControl control)
- {
- string path = Dialog.GetFilePath();
- RegistryUtil.PriceListPath = path;
- }
- }
-}