From 2299f49e242e1ec38e2a68c1725bbcc5de8b4496 Mon Sep 17 00:00:00 2001 From: Max Zheng <34936931+maxzh1999tw@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:33:19 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=AE=8C=E6=88=90=20API=20=E5=B8=B3?= =?UTF-8?q?=E8=99=9F=E7=B3=BB=E7=B5=B1=E8=88=87=E5=88=9D=E6=AD=A5=20Restfu?= =?UTF-8?q?l=20API=20=E5=98=97=E8=A9=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8eb67b45d57d67d4e273f051bfe194ef09559284. --- .../Plugins/ErrorRecordPluginExtention.cs | 26 ------------------- Excely.sln | 6 ----- Excely/Plugins/ErrorRecordPlugin.cs | 19 -------------- .../ClassListTableConverter.cs | 8 +++--- Excely/Workflows/ExcelyImporterBase.cs | 4 --- 5 files changed, 4 insertions(+), 59 deletions(-) delete mode 100644 Excely.EPPlus.LGPL/Plugins/ErrorRecordPluginExtention.cs delete mode 100644 Excely/Plugins/ErrorRecordPlugin.cs diff --git a/Excely.EPPlus.LGPL/Plugins/ErrorRecordPluginExtention.cs b/Excely.EPPlus.LGPL/Plugins/ErrorRecordPluginExtention.cs deleted file mode 100644 index 9c4dce1..0000000 --- a/Excely.EPPlus.LGPL/Plugins/ErrorRecordPluginExtention.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Excely.Plugins; -using OfficeOpenXml; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Excely.EPPlus.LGPL.Plugins -{ - public static class ErrorRecordPluginExtention - { - public static ExcelWorksheet ExportToWorksheet(this ErrorRecordPlugin errorRecordPlugin, bool errorRowOnly) - { - if(errorRecordPlugin?.Table == null) - { - throw new ArgumentNullException(); - } - - for(int rowIndex = 0; rowIndex < errorRecordPlugin.Table.MaxRowCount; rowIndex++) - { - if(!errorRecordPlugin.Errors.Keys.Any(cell => cell.Row == row)) - } - } - } -} diff --git a/Excely.sln b/Excely.sln index 63fe4e6..e1d14a8 100644 --- a/Excely.sln +++ b/Excely.sln @@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Excely.ClosedXML.UnitTests" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{05E1BF0C-B2F1-41C1-B5AB-52C001A3D557}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Debug", "Debug\Debug.csproj", "{7BCFF4FE-F23D-4BDC-8D32-E22148C29F08}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -43,10 +41,6 @@ Global {075DACAA-3E1D-46E6-B094-0E119B56673B}.Debug|Any CPU.Build.0 = Debug|Any CPU {075DACAA-3E1D-46E6-B094-0E119B56673B}.Release|Any CPU.ActiveCfg = Release|Any CPU {075DACAA-3E1D-46E6-B094-0E119B56673B}.Release|Any CPU.Build.0 = Release|Any CPU - {7BCFF4FE-F23D-4BDC-8D32-E22148C29F08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7BCFF4FE-F23D-4BDC-8D32-E22148C29F08}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7BCFF4FE-F23D-4BDC-8D32-E22148C29F08}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7BCFF4FE-F23D-4BDC-8D32-E22148C29F08}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Excely/Plugins/ErrorRecordPlugin.cs b/Excely/Plugins/ErrorRecordPlugin.cs deleted file mode 100644 index 6b46083..0000000 --- a/Excely/Plugins/ErrorRecordPlugin.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Excely.Plugins -{ - public class ErrorRecordPlugin - { - public ExcelyTable? Table { get; set; } - - public Dictionary Errors { get; set; } = new Dictionary(); - - public void DoAfterGetTable(ExcelyTable table) - { - Table = table; - } - - public void RecordError(CellLocation location, string errorMessage) - { - Errors[location] = errorMessage; - } - } -} diff --git a/Excely/TableConverters/ClassListTableConverter.cs b/Excely/TableConverters/ClassListTableConverter.cs index cdc64a0..dbbfc98 100644 --- a/Excely/TableConverters/ClassListTableConverter.cs +++ b/Excely/TableConverters/ClassListTableConverter.cs @@ -92,11 +92,11 @@ private IEnumerable ImportInternal(ExcelyTable table, Func ImportInternal(ExcelyTable table, Func { protected abstract ExcelyTable GetTable(TInput input); - public List> DoAfterGetTableCallbackList { get; set; } = new List>(); - /// /// 將資料匯入為物件列表。 /// @@ -25,7 +23,6 @@ public IEnumerable ToClassList( where TClass : class, new() { var table = GetTable(dataSource); - DoAfterGetTableCallbackList.ForEach(x => x.Invoke(table)); var converter = options == null ? new ClassListTableConverter() : new ClassListTableConverter(options); return converter.ConvertFrom(table); } @@ -41,7 +38,6 @@ public IEnumerable ToClassList( DictionaryListTableConverterOptions? options = null) { var table = GetTable(dataSource); - DoAfterGetTableCallbackList.ForEach(x => x.Invoke(table)); var converter = options == null ? new DictionaryListTableConverter() : new DictionaryListTableConverter(options); return converter.ConvertFrom(table); }