From 1dfbfaa461479a14cd75c6fc5f6a5082e61c6371 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 2 Feb 2022 18:05:49 +0300 Subject: [PATCH] Rename Abstract PriceList inheritors --- src/Interface/RibbonController.cs | 4 ++-- src/PriceListTools/AbstractTool.cs | 4 ++-- src/PriceListTools/CombineTool.cs | 4 ++-- src/PriceListTools/ConvertTool.cs | 4 ++-- src/PriceListTools/MergeTool.cs | 4 ++-- src/PriceListTools/{Source.cs => SourcePriceList.cs} | 10 +++++----- src/PriceListTools/{Target.cs => TargetPriceList.cs} | 4 ++-- src/RehauSku.Assist.csproj | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) rename src/PriceListTools/{Source.cs => SourcePriceList.cs} (90%) rename src/PriceListTools/{Target.cs => TargetPriceList.cs} (89%) diff --git a/src/Interface/RibbonController.cs b/src/Interface/RibbonController.cs index cd7058d..2b1fd6b 100644 --- a/src/Interface/RibbonController.cs +++ b/src/Interface/RibbonController.cs @@ -40,7 +40,7 @@ namespace RehauSku.Interface if (files.Length != 0) { - mergeTool.SourceFiles = Source.GetSourceLists(files); + mergeTool.SourceFiles = SourcePriceList.GetSourceLists(files); mergeTool.OpenNewPrice(); mergeTool.FillTarget(); } @@ -53,7 +53,7 @@ namespace RehauSku.Interface if (files.Length != 0) { - combineTool.SourceFiles = Source.GetSourceLists(files); + combineTool.SourceFiles = SourcePriceList.GetSourceLists(files); combineTool.OpenNewPrice(); combineTool.FillTarget(); } diff --git a/src/PriceListTools/AbstractTool.cs b/src/PriceListTools/AbstractTool.cs index 77dc63c..a86fd95 100644 --- a/src/PriceListTools/AbstractTool.cs +++ b/src/PriceListTools/AbstractTool.cs @@ -10,7 +10,7 @@ namespace RehauSku.PriceListTools internal abstract class AbstractTool { protected private Application ExcelApp = (Application)ExcelDnaUtil.Application; - protected private Target TargetFile; + protected private TargetPriceList TargetFile; public void OpenNewPrice() { @@ -18,7 +18,7 @@ namespace RehauSku.PriceListTools try { - TargetFile = new Target(wb); + TargetFile = new TargetPriceList(wb); } catch (Exception ex) diff --git a/src/PriceListTools/CombineTool.cs b/src/PriceListTools/CombineTool.cs index 3222dae..80c7a67 100644 --- a/src/PriceListTools/CombineTool.cs +++ b/src/PriceListTools/CombineTool.cs @@ -7,13 +7,13 @@ namespace RehauSku.PriceListTools { internal class CombineTool : AbstractTool { - public List SourceFiles; + public List SourceFiles; public void FillTarget() { ProgressBar bar = new ProgressBar(SourceFiles.Sum(file => file.PositionAmount.Count)); - foreach (Source source in SourceFiles) + foreach (SourcePriceList source in SourceFiles) { TargetFile.Sheet.Columns[TargetFile.amountCell.Column] .EntireColumn diff --git a/src/PriceListTools/ConvertTool.cs b/src/PriceListTools/ConvertTool.cs index 7308be9..58044ed 100644 --- a/src/PriceListTools/ConvertTool.cs +++ b/src/PriceListTools/ConvertTool.cs @@ -5,13 +5,13 @@ namespace RehauSku.PriceListTools { internal class ConvertTool : AbstractTool { - private Source Current; + private SourcePriceList Current; public void GetCurrent() { try { - Current = new Source(ExcelApp.ActiveWorkbook); + Current = new SourcePriceList(ExcelApp.ActiveWorkbook); } catch (Exception exception) diff --git a/src/PriceListTools/MergeTool.cs b/src/PriceListTools/MergeTool.cs index d31cc8a..22e443f 100644 --- a/src/PriceListTools/MergeTool.cs +++ b/src/PriceListTools/MergeTool.cs @@ -6,13 +6,13 @@ namespace RehauSku.PriceListTools { internal class MergeTool : AbstractTool { - public List SourceFiles; + public List SourceFiles; public void FillTarget() { ProgressBar bar = new ProgressBar(SourceFiles.Sum(x => x.PositionAmount.Count)); - foreach (Source source in SourceFiles) + foreach (SourcePriceList source in SourceFiles) { foreach (var kvp in source.PositionAmount) { diff --git a/src/PriceListTools/Source.cs b/src/PriceListTools/SourcePriceList.cs similarity index 90% rename from src/PriceListTools/Source.cs rename to src/PriceListTools/SourcePriceList.cs index a20ad81..a5ee73a 100644 --- a/src/PriceListTools/Source.cs +++ b/src/PriceListTools/SourcePriceList.cs @@ -7,11 +7,11 @@ using RehauSku.Interface; namespace RehauSku.PriceListTools { - internal class Source : AbstractPriceList + internal class SourcePriceList : AbstractPriceList { public Dictionary PositionAmount { get; private set; } - public Source(Workbook workbook) + public SourcePriceList(Workbook workbook) { if (workbook == null) { @@ -37,12 +37,12 @@ namespace RehauSku.PriceListTools CreatePositionsDict(); } - public static List GetSourceLists(string[] files) + public static List GetSourceLists(string[] files) { var ExcelApp = (Application)ExcelDnaUtil.Application; ProgressBar bar = new ProgressBar(files.Length); - List sourceFiles = new List(); + List sourceFiles = new List(); foreach (string file in files) { @@ -50,7 +50,7 @@ namespace RehauSku.PriceListTools Workbook wb = ExcelApp.Workbooks.Open(file); try { - Source priceList = new Source(wb); + SourcePriceList priceList = new SourcePriceList(wb); sourceFiles.Add(priceList); wb.Close(); bar.DoProgress(); diff --git a/src/PriceListTools/Target.cs b/src/PriceListTools/TargetPriceList.cs similarity index 89% rename from src/PriceListTools/Target.cs rename to src/PriceListTools/TargetPriceList.cs index ac91544..2c2f029 100644 --- a/src/PriceListTools/Target.cs +++ b/src/PriceListTools/TargetPriceList.cs @@ -4,12 +4,12 @@ using System.Linq; namespace RehauSku.PriceListTools { - internal class Target : AbstractPriceList + internal class TargetPriceList : AbstractPriceList { private const string oldSkuHeader = "Прежний материал"; public Range oldSkuCell { get; private set; } - public Target(Workbook workbook) + public TargetPriceList(Workbook workbook) { Sheet = workbook.ActiveSheet; Name = workbook.FullName; diff --git a/src/RehauSku.Assist.csproj b/src/RehauSku.Assist.csproj index 6edbc2c..25fa5a5 100644 --- a/src/RehauSku.Assist.csproj +++ b/src/RehauSku.Assist.csproj @@ -128,8 +128,8 @@ - - + +