diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/AddIn.cs (renamed from src/AddIn/AddIn.cs) | 3 | ||||
-rw-r--r-- | src/Controllers/CombineTool.cs (renamed from src/PriceListTools/CombineTool.cs) | 6 | ||||
-rw-r--r-- | src/Controllers/ConvertTool.cs (renamed from src/PriceListTools/ConvertTool.cs) | 4 | ||||
-rw-r--r-- | src/Controllers/ExportTool.cs (renamed from src/PriceListTools/ExportTool.cs) | 4 | ||||
-rw-r--r-- | src/Controllers/MergeTool.cs (renamed from src/PriceListTools/MergeTool.cs) | 4 | ||||
-rw-r--r-- | src/Controllers/RibbonController.cs (renamed from src/Interface/RibbonController.cs) | 16 | ||||
-rw-r--r-- | src/Controllers/ToolBase.cs (renamed from src/PriceListTools/ToolBase.cs) | 8 | ||||
-rw-r--r-- | src/Models/Dialog.cs (renamed from src/Interface/Dialog.cs) | 2 | ||||
-rw-r--r-- | src/Models/PriceListBase.cs (renamed from src/PriceListTools/PriceListBase.cs) | 2 | ||||
-rw-r--r-- | src/Models/PriceListHeaders.cs (renamed from src/PriceListTools/PriceListHeaders.cs) | 2 | ||||
-rw-r--r-- | src/Models/Product.cs (renamed from src/PriceListTools/Product.cs) | 2 | ||||
-rw-r--r-- | src/Models/ProgressBar.cs (renamed from src/Interface/ProgressBar.cs) | 4 | ||||
-rw-r--r-- | src/Models/ResultBar.cs (renamed from src/Interface/ResultBar.cs) | 2 | ||||
-rw-r--r-- | src/Models/Sku.cs (renamed from src/AddIn/Sku.cs) | 2 | ||||
-rw-r--r-- | src/Models/SkuExtensions.cs (renamed from src/AddIn/SkuExtensions.cs) | 2 | ||||
-rw-r--r-- | src/Models/SourcePriceList.cs (renamed from src/PriceListTools/SourcePriceList.cs) | 3 | ||||
-rw-r--r-- | src/Models/StatusbarBase.cs (renamed from src/Interface/StatusbarBase.cs) | 6 | ||||
-rw-r--r-- | src/Models/TargetPriceList.cs (renamed from src/PriceListTools/TargetPriceList.cs) | 4 | ||||
-rw-r--r-- | src/Models/WorksheetExtensions.cs (renamed from src/AddIn/WorksheetExtensions.cs) | 4 | ||||
-rw-r--r-- | src/RhSolutions-AddIn.dna | 2 | ||||
-rw-r--r-- | src/RhSolutions.csproj | 50 | ||||
-rw-r--r-- | src/Services/EventsUtil.cs (renamed from src/AddIn/EventsUtil.cs) | 9 | ||||
-rw-r--r-- | src/Services/Functions.cs (renamed from src/AddIn/Functions.cs) | 2 | ||||
-rw-r--r-- | src/Services/RegistryUtil.cs (renamed from src/AddIn/RegistryUtil.cs) | 9 | ||||
-rw-r--r-- | src/Services/RhDatabaseClient.cs (renamed from src/AddIn/RhDatabaseClient.cs) | 4 |
25 files changed, 79 insertions, 77 deletions
diff --git a/src/AddIn/AddIn.cs b/src/AddIn.cs index b8bfd21..8c44821 100644 --- a/src/AddIn/AddIn.cs +++ b/src/AddIn.cs @@ -1,12 +1,13 @@ using ExcelDna.Integration; using ExcelDna.IntelliSense; using Microsoft.Office.Interop.Excel; +using RhSolutions.Services; using System.Net.Http; using System.Runtime.Caching; namespace RhSolutions { - class AddIn : IExcelAddIn + class RhSolutionsAddIn : IExcelAddIn { public static Application Excel; public static HttpClient httpClient; diff --git a/src/PriceListTools/CombineTool.cs b/src/Controllers/CombineTool.cs index e0429bd..75c0f51 100644 --- a/src/PriceListTools/CombineTool.cs +++ b/src/Controllers/CombineTool.cs @@ -1,11 +1,11 @@ using Microsoft.Office.Interop.Excel; -using RhSolutions.Interface; +using RhSolutions.Models; using System; using System.Collections.Generic; using System.Linq; -using Dialog = RhSolutions.Interface.Dialog; +using Dialog = RhSolutions.Models.Dialog; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Controllers { internal class CombineTool : ToolBase { diff --git a/src/PriceListTools/ConvertTool.cs b/src/Controllers/ConvertTool.cs index 788d6ff..5b2cd4d 100644 --- a/src/PriceListTools/ConvertTool.cs +++ b/src/Controllers/ConvertTool.cs @@ -1,6 +1,6 @@ -using RhSolutions.Interface; +using RhSolutions.Models; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Controllers { internal class ConvertTool : ToolBase { diff --git a/src/PriceListTools/ExportTool.cs b/src/Controllers/ExportTool.cs index c21e9b1..6d8c348 100644 --- a/src/PriceListTools/ExportTool.cs +++ b/src/Controllers/ExportTool.cs @@ -1,9 +1,9 @@ using Microsoft.Office.Interop.Excel; using System; using System.Collections.Generic; -using RhSolutions.Interface; +using RhSolutions.Models; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Controllers { internal class ExportTool : ToolBase { diff --git a/src/PriceListTools/MergeTool.cs b/src/Controllers/MergeTool.cs index 3a945dd..dec8ff7 100644 --- a/src/PriceListTools/MergeTool.cs +++ b/src/Controllers/MergeTool.cs @@ -1,9 +1,9 @@ -using RhSolutions.Interface; +using RhSolutions.Models; using System; using System.Collections.Generic; using System.Linq; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Controllers { internal class MergeTool : ToolBase { diff --git a/src/Interface/RibbonController.cs b/src/Controllers/RibbonController.cs index 6bbba3e..87c62e1 100644 --- a/src/Interface/RibbonController.cs +++ b/src/Controllers/RibbonController.cs @@ -1,13 +1,13 @@ using ExcelDna.Integration.CustomUI; using Microsoft.Office.Interop.Excel; -using RhSolutions.PriceListTools; +using RhSolutions.Services; using System; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Windows.Forms; -namespace RhSolutions.Interface +namespace RhSolutions.Controllers { [ComVisible(true)] public class RibbonController : ExcelRibbon @@ -52,7 +52,7 @@ namespace RhSolutions.Interface } public void OnSetPricePressed(IRibbonControl control) { - string path = Dialog.GetFilePath(); + string path = Models.Dialog.GetFilePath(); if (!string.IsNullOrEmpty(path)) { @@ -93,31 +93,31 @@ namespace RhSolutions.Interface "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information); - AddIn.Excel.StatusBar = false; + RhSolutionsAddIn.Excel.StatusBar = false; return; } } public bool GetConvertEnabled(IRibbonControl control) { - if (AddIn.Excel.ActiveWorkbook == null) + if (RhSolutionsAddIn.Excel.ActiveWorkbook == null) return false; else { - Worksheet worksheet = AddIn.Excel.ActiveWorkbook.ActiveSheet; + Worksheet worksheet = RhSolutionsAddIn.Excel.ActiveWorkbook.ActiveSheet; return worksheet.IsRehauSource(); } } public bool GetExportEnabled(IRibbonControl control) { - if (AddIn.Excel.ActiveWorkbook == null) + if (RhSolutionsAddIn.Excel.ActiveWorkbook == null) return false; else { - Range selection = AddIn.Excel.Selection; + Range selection = RhSolutionsAddIn.Excel.Selection; return selection.Columns.Count == 2; } } diff --git a/src/PriceListTools/ToolBase.cs b/src/Controllers/ToolBase.cs index d64522d..87eb9d9 100644 --- a/src/PriceListTools/ToolBase.cs +++ b/src/Controllers/ToolBase.cs @@ -1,15 +1,15 @@ using Microsoft.Office.Interop.Excel; -using RhSolutions.Interface; +using RhSolutions.Models; +using RhSolutions.Services; using System; using System.Collections.Generic; using System.Linq; -using ProgressBar = RhSolutions.Interface.ProgressBar; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Controllers { internal abstract class ToolBase { - protected Application ExcelApp = AddIn.Excel; + protected Application ExcelApp = RhSolutionsAddIn.Excel; protected TargetPriceList TargetFile { get; set; } protected ResultBar ResultBar { get; set; } protected ProgressBar ProgressBar { get; set; } diff --git a/src/Interface/Dialog.cs b/src/Models/Dialog.cs index 992368c..abc89b8 100644 --- a/src/Interface/Dialog.cs +++ b/src/Models/Dialog.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Windows.Forms; -namespace RhSolutions.Interface +namespace RhSolutions.Models { static class Dialog { diff --git a/src/PriceListTools/PriceListBase.cs b/src/Models/PriceListBase.cs index 805cd04..95f385d 100644 --- a/src/PriceListTools/PriceListBase.cs +++ b/src/Models/PriceListBase.cs @@ -1,6 +1,6 @@ using Microsoft.Office.Interop.Excel; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Models { internal abstract class PriceListBase { diff --git a/src/PriceListTools/PriceListHeaders.cs b/src/Models/PriceListHeaders.cs index 9c09ed7..c9a8370 100644 --- a/src/PriceListTools/PriceListHeaders.cs +++ b/src/Models/PriceListHeaders.cs @@ -1,4 +1,4 @@ -namespace RhSolutions.PriceListTools +namespace RhSolutions.Models { internal static class PriceListHeaders { diff --git a/src/PriceListTools/Product.cs b/src/Models/Product.cs index e631293..2f092d1 100644 --- a/src/PriceListTools/Product.cs +++ b/src/Models/Product.cs @@ -1,6 +1,6 @@ using System.Linq; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Models { public class Product { diff --git a/src/Interface/ProgressBar.cs b/src/Models/ProgressBar.cs index 7217d4e..82012e5 100644 --- a/src/Interface/ProgressBar.cs +++ b/src/Models/ProgressBar.cs @@ -1,4 +1,4 @@ -namespace RhSolutions.Interface +namespace RhSolutions.Models { internal class ProgressBar : StatusbarBase { @@ -15,7 +15,7 @@ public override void Update() { - double percent = (++CurrentProgress / TaskWeight) * 100; + double percent = ++CurrentProgress / TaskWeight * 100; Excel.StatusBar = $"{Message} Выполнено {percent:#.#} %"; } } diff --git a/src/Interface/ResultBar.cs b/src/Models/ResultBar.cs index 3652738..655540c 100644 --- a/src/Interface/ResultBar.cs +++ b/src/Models/ResultBar.cs @@ -1,7 +1,7 @@ using System; using System.Text; -namespace RhSolutions.Interface +namespace RhSolutions.Models { internal class ResultBar : StatusbarBase { diff --git a/src/AddIn/Sku.cs b/src/Models/Sku.cs index aaf5937..1c5e477 100644 --- a/src/AddIn/Sku.cs +++ b/src/Models/Sku.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace RhSolutions +namespace RhSolutions.Models { internal class Sku { diff --git a/src/AddIn/SkuExtensions.cs b/src/Models/SkuExtensions.cs index 2e97406..160dc16 100644 --- a/src/AddIn/SkuExtensions.cs +++ b/src/Models/SkuExtensions.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace RhSolutions +namespace RhSolutions.Models { static class SkuExtensions { diff --git a/src/PriceListTools/SourcePriceList.cs b/src/Models/SourcePriceList.cs index 4e43d7a..d210c10 100644 --- a/src/PriceListTools/SourcePriceList.cs +++ b/src/Models/SourcePriceList.cs @@ -3,9 +3,8 @@ using Microsoft.Office.Interop.Excel; using System; using System.Collections.Generic; using System.Linq; -using RhSolutions.Interface; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Models { internal class SourcePriceList : PriceListBase { diff --git a/src/Interface/StatusbarBase.cs b/src/Models/StatusbarBase.cs index f1af972..a1be5ed 100644 --- a/src/Interface/StatusbarBase.cs +++ b/src/Models/StatusbarBase.cs @@ -4,17 +4,17 @@ using System; using System.Threading; using System.Threading.Tasks; -namespace RhSolutions.Interface +namespace RhSolutions.Models { internal abstract class StatusbarBase : IDisposable { - protected Application Excel = AddIn.Excel; + protected Application Excel = RhSolutionsAddIn.Excel; public abstract void Update(); private static void ResetStatusBar() { - AddIn.Excel.StatusBar = false; + RhSolutionsAddIn.Excel.StatusBar = false; } public void Dispose() diff --git a/src/PriceListTools/TargetPriceList.cs b/src/Models/TargetPriceList.cs index e360062..4754049 100644 --- a/src/PriceListTools/TargetPriceList.cs +++ b/src/Models/TargetPriceList.cs @@ -2,7 +2,7 @@ using System; using System.Linq; -namespace RhSolutions.PriceListTools +namespace RhSolutions.Models { internal class TargetPriceList : PriceListBase { @@ -31,7 +31,7 @@ namespace RhSolutions.PriceListTools if (cells.Any(x => x == null)) { - throw new ArgumentException($"Шаблон { Name } не является прайс-листом"); + throw new ArgumentException($"Шаблон {Name} не является прайс-листом"); } } } diff --git a/src/AddIn/WorksheetExtensions.cs b/src/Models/WorksheetExtensions.cs index b07e2c1..6b5fc3e 100644 --- a/src/AddIn/WorksheetExtensions.cs +++ b/src/Models/WorksheetExtensions.cs @@ -1,8 +1,8 @@ using Microsoft.Office.Interop.Excel; -using RhSolutions.PriceListTools; +using RhSolutions.Models; using System.Linq; -namespace RhSolutions +namespace RhSolutions.Services { public static class WorksheetExtensions { diff --git a/src/RhSolutions-AddIn.dna b/src/RhSolutions-AddIn.dna index 3b9f26a..eecb271 100644 --- a/src/RhSolutions-AddIn.dna +++ b/src/RhSolutions-AddIn.dna @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <DnaLibrary Name="RhSolutions Add-In" RuntimeVersion="v4.0" xmlns="http://schemas.excel-dna.net/addin/2020/07/dnalibrary"> - <ExternalLibrary Path="RhExcelAddin.dll" ExplicitExports="false" LoadFromBytes="true" Pack="true" IncludePdb="false" /> + <ExternalLibrary Path="RhSolutions.AddIn.dll" ExplicitExports="false" LoadFromBytes="true" Pack="true" IncludePdb="false" /> <!-- The RuntimeVersion attribute above allows only the following setting: diff --git a/src/RhSolutions.csproj b/src/RhSolutions.csproj index 630d440..31c90cb 100644 --- a/src/RhSolutions.csproj +++ b/src/RhSolutions.csproj @@ -8,8 +8,8 @@ <ProjectGuid>{18A2FF67-0E46-4A86-B872-29F2B3F23ADF}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>RhExcelAddin</RootNamespace> - <AssemblyName>RhExcelAddin</AssemblyName> + <RootNamespace>RhSolutions.AddIn</RootNamespace> + <AssemblyName>RhSolutions.AddIn</AssemblyName> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <Deterministic>true</Deterministic> @@ -77,29 +77,29 @@ <Reference Include="WindowsBase" /> </ItemGroup> <ItemGroup> - <Compile Include="AddIn\EventsUtil.cs" /> - <Compile Include="AddIn\RhDatabaseClient.cs" /> - <Compile Include="AddIn\Sku.cs" /> - <Compile Include="Interface\StatusbarBase.cs" /> - <Compile Include="Interface\Dialog.cs" /> - <Compile Include="AddIn\RegistryUtil.cs" /> - <Compile Include="AddIn\SkuExtensions.cs" /> - <Compile Include="Interface\ProgressBar.cs" /> - <Compile Include="Interface\ResultBar.cs" /> - <Compile Include="PriceListTools\CombineTool.cs" /> - <Compile Include="PriceListTools\ConvertTool.cs" /> - <Compile Include="PriceListTools\Product.cs" /> - <Compile Include="PriceListTools\ToolBase.cs" /> - <Compile Include="PriceListTools\MergeTool.cs" /> - <Compile Include="PriceListTools\PriceListBase.cs" /> - <Compile Include="PriceListTools\PriceListHeaders.cs" /> - <Compile Include="PriceListTools\SourcePriceList.cs" /> - <Compile Include="PriceListTools\TargetPriceList.cs" /> - <Compile Include="Interface\RibbonController.cs" /> - <Compile Include="PriceListTools\ExportTool.cs" /> - <Compile Include="AddIn\AddIn.cs" /> - <Compile Include="AddIn\Functions.cs" /> - <Compile Include="AddIn\WorksheetExtensions.cs" /> + <Compile Include="Services\EventsUtil.cs" /> + <Compile Include="Services\RhDatabaseClient.cs" /> + <Compile Include="Models\Sku.cs" /> + <Compile Include="Models\StatusbarBase.cs" /> + <Compile Include="Models\Dialog.cs" /> + <Compile Include="Services\RegistryUtil.cs" /> + <Compile Include="Models\SkuExtensions.cs" /> + <Compile Include="Models\ProgressBar.cs" /> + <Compile Include="Models\ResultBar.cs" /> + <Compile Include="Controllers\CombineTool.cs" /> + <Compile Include="Controllers\ConvertTool.cs" /> + <Compile Include="Models\Product.cs" /> + <Compile Include="Controllers\ToolBase.cs" /> + <Compile Include="Controllers\MergeTool.cs" /> + <Compile Include="Models\PriceListBase.cs" /> + <Compile Include="Models\PriceListHeaders.cs" /> + <Compile Include="Models\SourcePriceList.cs" /> + <Compile Include="Models\TargetPriceList.cs" /> + <Compile Include="Controllers\RibbonController.cs" /> + <Compile Include="Controllers\ExportTool.cs" /> + <Compile Include="AddIn.cs" /> + <Compile Include="Services\Functions.cs" /> + <Compile Include="Models\WorksheetExtensions.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> diff --git a/src/AddIn/EventsUtil.cs b/src/Services/EventsUtil.cs index 3ceccfd..4b1d923 100644 --- a/src/AddIn/EventsUtil.cs +++ b/src/Services/EventsUtil.cs @@ -1,10 +1,11 @@ using Microsoft.Office.Interop.Excel; +using RhSolutions.Controllers; -namespace RhSolutions +namespace RhSolutions.Services { internal static class EventsUtil { - private static readonly Application Excel = AddIn.Excel; + private static readonly Application Excel = RhSolutionsAddIn.Excel; public static void Initialize() { @@ -22,12 +23,12 @@ namespace RhSolutions private static void RefreshConvertButton(object sh) { - Interface.RibbonController.RefreshControl("convert"); + RibbonController.RefreshControl("convert"); } private static void RefreshExportButton(object sh, Range target) { - Interface.RibbonController.RefreshControl("export"); + RibbonController.RefreshControl("export"); } } } diff --git a/src/AddIn/Functions.cs b/src/Services/Functions.cs index 5bcfd45..22b67e0 100644 --- a/src/AddIn/Functions.cs +++ b/src/Services/Functions.cs @@ -1,7 +1,7 @@ using ExcelDna.Integration; using System; -namespace RhSolutions +namespace RhSolutions.Services { public class Functions { diff --git a/src/AddIn/RegistryUtil.cs b/src/Services/RegistryUtil.cs index e848462..8b165ea 100644 --- a/src/AddIn/RegistryUtil.cs +++ b/src/Services/RegistryUtil.cs @@ -1,10 +1,11 @@ using Microsoft.Win32; -using RhSolutions.Interface; +using RhSolutions.Controllers; +using RhSolutions.Models; using System; using System.IO; using System.Windows.Forms; -namespace RhSolutions +namespace RhSolutions.Services { static class RegistryUtil { @@ -13,13 +14,13 @@ namespace RhSolutions public static void Initialize() { - RootKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\REHAU\SkuAssist"); + RootKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\REHAU\SkuAssist"); priceListPath = RootKey.GetValue("PriceListPath") as string; } public static void Uninitialize() { - RootKey.Close(); + RootKey.Close(); } public static string PriceListPath diff --git a/src/AddIn/RhDatabaseClient.cs b/src/Services/RhDatabaseClient.cs index 3a2de5c..c57d4d8 100644 --- a/src/AddIn/RhDatabaseClient.cs +++ b/src/Services/RhDatabaseClient.cs @@ -5,11 +5,11 @@ using System.Net; using System.Net.Http; using System.Threading.Tasks; -namespace RhSolutions +namespace RhSolutions.Services { public static class RhDatabaseClient { - private static HttpClient httpClient = AddIn.httpClient; + private static HttpClient httpClient = RhSolutionsAddIn.httpClient; public static async Task<object> GetProduct(string line) { |