diff --git a/Documentation/CodeTutorials/Packages.md b/Documentation/CodeTutorials/Packages.md index 1ecf3ccd62..44d50761dc 100644 --- a/Documentation/CodeTutorials/Packages.md +++ b/Documentation/CodeTutorials/Packages.md @@ -33,17 +33,8 @@ | YamlDotNet | [GitHub](https://github.com/aaubry/YamlDotNet) | [MIT](https://opensource.org/licenses/MIT) |Loading configuration files| | SixLabors.ImageSharp | [GitHub](https://github.com/SixLabors/ImageSharp) | [Apache 2.0](https://github.com/SixLabors/ImageSharp/blob/main/LICENSE) | Platform-independent replacement for legacy Windows-only System.Drawing.Common | | | SixLabors.ImageSharp.Drawing | [GitHub](https://github.com/SixLabors/ImageSharp.Drawing) | [Apache 2.0](https://github.com/SixLabors/ImageSharp/blob/main/LICENSE) | Font handling for ImageSharp | | -| System.Runtime.Loader | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Allows loading assemblies in dot net core| | -| System.Diagnostics.Debug | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Interact with Processes / Debug / Console | | -| System.IO.FileSystem.Primitives | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Provides common enumerations and exceptions for path-based I/O libraries | | -| System.IO.FileSystem | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Provides types that allow reading and writing to files | | -| System.Runtime.Extensions | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Provides commonly-used classes for performing mathematical functions, conversions, string comparisons etc | | -| System.Threading | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Provides the fundamental synchronization primitives | | | System.Threading.AccessControl | [GitHub](https://github.com/dotnet/runtime) |[MIT](https://opensource.org/licenses/MIT) | Required by Scintilla for sync primitives | | | System.Threading.ThreadPool | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Required to compile native linux binaries | | -| System.Globalization | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Provides classes that define culture-related information | | -| System.Net.NameResolution | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Provides the System.Net.Dns class, which enables developers to perform simple domain name resolution | | -| System.Net.Primitives | [GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Provides common types for network-based libraries | | | System.Security.Permissions |[GitHub](https://github.com/dotnet/corefx) |[MIT](https://opensource.org/licenses/MIT) | Provides common types for Xml doc reading in UI code | | | [AutoComplete Console](https://www.codeproject.com/Articles/1182358/Using-Autocomplete-in-Windows-Console-Applications) by Jasper Lammers | Embedded | [CPOL](https://www.codeproject.com/info/cpol10.aspx) | Provides interactive autocomplete in console input | | | System.Resources.Extensions | [GitHub](https://github.com/dotnet/corefx) | [MIT](https://opensource.org/licenses/MIT) | Allows [publishing with dotnet publish on machines with netcoreapp3.0 SDK installed](https://github.com/microsoft/msbuild/issues/4704#issuecomment-530034240) | | diff --git a/Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs b/Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs index 34ff3248d1..53d458e17b 100644 --- a/Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs +++ b/Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs @@ -21,6 +21,7 @@ using Rdmp.Core.DataFlowPipeline; using Rdmp.Core.DataFlowPipeline.Requirements; using Rdmp.Core.DataLoad.Modules.Exceptions; +using Rdmp.Core.ReusableLibraryCode.Annotations; using Rdmp.Core.ReusableLibraryCode.Checks; using Rdmp.Core.ReusableLibraryCode.Progress; @@ -198,7 +199,7 @@ public DataTable GetAllData(ISheet worksheet, IDataLoadEventListener listener) /// The cell whose value you want to retrieve /// Leave blank, used in recursion for dealing with Formula cells /// - private object GetCellValue(ICell cell, CellType treatAs = CellType.Unknown) + private object GetCellValue([CanBeNull] ICell cell, CellType treatAs = CellType.Unknown) { if (cell == null) return null; @@ -218,8 +219,8 @@ private object GetCellValue(ICell cell, CellType treatAs = CellType.Unknown) //some numerics are actually dates/times if (cell.CellStyle.DataFormat == 0) return cell.NumericCellValue; + var format = cell.CellStyle.GetDataFormatString(); - var f = new NumberFormat(format); if (IsDateWithoutTime(format)) return cell.DateCellValue.ToString("yyyy-MM-dd"); @@ -230,19 +231,17 @@ private object GetCellValue(ICell cell, CellType treatAs = CellType.Unknown) if (IsTimeWithoutDate(format)) return cell.DateCellValue.ToString("HH:mm:ss"); - return IsDateFormat(format) - ? f.Format(cell.DateCellValue, CultureInfo.InvariantCulture) - : f.Format(cell.NumericCellValue, CultureInfo.InvariantCulture); + return new NumberFormat(format).Format( + IsDateFormat(format) ? cell.DateCellValue : cell.NumericCellValue, CultureInfo.InvariantCulture); case CellType.String: - var v = cell.StringCellValue; - //if it is blank or 'null' then leave it null - if (string.IsNullOrWhiteSpace(v) || v.Trim().Equals("NULL", StringComparison.CurrentCultureIgnoreCase)) - return null; + return string.IsNullOrWhiteSpace(cell.StringCellValue) || + cell.StringCellValue.Trim().Equals("NULL", StringComparison.CurrentCultureIgnoreCase) + ? null + : cell.StringCellValue; - return cell.StringCellValue; case CellType.Formula: return GetCellValue(cell, cell.CachedFormulaResultType); case CellType.Blank: @@ -252,7 +251,7 @@ private object GetCellValue(ICell cell, CellType treatAs = CellType.Unknown) case CellType.Error: return null; default: - throw new ArgumentOutOfRangeException(); + throw new ArgumentOutOfRangeException(nameof(treatAs)); } } diff --git a/Rdmp.Core/Rdmp.Core.csproj b/Rdmp.Core/Rdmp.Core.csproj index f3571bf0a1..36aaf5325f 100644 --- a/Rdmp.Core/Rdmp.Core.csproj +++ b/Rdmp.Core/Rdmp.Core.csproj @@ -45,10 +45,8 @@ - - + + @@ -57,14 +55,11 @@ - + - + - + @@ -79,17 +74,14 @@ - + - + - + @@ -97,15 +89,13 @@ - + - + @@ -130,25 +120,21 @@ - + - + - + - + @@ -183,109 +169,73 @@ - + Never - - + + - - - - + + + + - - - - + + + + - - - + + + - + - + - - - - + + + + - - - - - + + + + + - - - + + + - - - + + + - - + + - + - - + + @@ -299,37 +249,25 @@ - - - - + + + + - - - + + + - - + + - + - - + + @@ -339,21 +277,17 @@ - + - - + + - + @@ -376,20 +310,10 @@ - - - - - - - - - - - + diff --git a/Tools/rdmp/rdmp.csproj b/Tools/rdmp/rdmp.csproj index 6cb25ae8c2..f7c580b0de 100644 --- a/Tools/rdmp/rdmp.csproj +++ b/Tools/rdmp/rdmp.csproj @@ -41,7 +41,7 @@ - +