From 88475cb1344bb9e514f5a1f5eba41992fd7acf48 Mon Sep 17 00:00:00 2001 From: BHoMBot Date: Fri, 22 Dec 2023 14:16:42 +0000 Subject: [PATCH 01/10] Upgrade AssemblyFileVersion to 7.1.0.0 --- Excel_Adapter/Excel_Adapter.csproj | 2 +- Excel_Engine/Excel_Engine.csproj | 2 +- Excel_oM/Excel_oM.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Excel_Adapter/Excel_Adapter.csproj b/Excel_Adapter/Excel_Adapter.csproj index 2540858..7793263 100644 --- a/Excel_Adapter/Excel_Adapter.csproj +++ b/Excel_Adapter/Excel_Adapter.csproj @@ -7,7 +7,7 @@ BHoM Copyright © https://github.com/BHoM BH.Adapter.Excel - 7.0.0.0 + 7.1.0.0 Debug;Release;ZeroCodeTool ..\Build\ true diff --git a/Excel_Engine/Excel_Engine.csproj b/Excel_Engine/Excel_Engine.csproj index a2e5557..911d867 100644 --- a/Excel_Engine/Excel_Engine.csproj +++ b/Excel_Engine/Excel_Engine.csproj @@ -7,7 +7,7 @@ BHoM Copyright © https://github.com/BHoM BH.Engine.Excel - 7.0.0.0 + 7.1.0.0 Debug;Release;ZeroCodeTool ..\Build\ true diff --git a/Excel_oM/Excel_oM.csproj b/Excel_oM/Excel_oM.csproj index a8700b5..07e1847 100644 --- a/Excel_oM/Excel_oM.csproj +++ b/Excel_oM/Excel_oM.csproj @@ -7,7 +7,7 @@ BHoM Copyright © https://github.com/BHoM BH.oM.Excel - 7.0.0.0 + 7.1.0.0 Debug;Release;ZeroCodeTool ..\Build\ true From c4f39700dd58d173ad82f44e1cf81ec22e4d8e51 Mon Sep 17 00:00:00 2001 From: BHoMBot Date: Tue, 2 Jan 2024 14:21:16 +0000 Subject: [PATCH 02/10] Uptick copyright headers to 2024 --- Excel_Adapter/AdapterActions/Pull.cs | 3 ++- Excel_Adapter/AdapterActions/Push.cs | 3 ++- Excel_Adapter/CRUD/Create/Create.cs | 3 ++- Excel_Adapter/CRUD/Delete/Delete.cs | 3 ++- Excel_Adapter/CRUD/Read/Read.cs | 3 ++- Excel_Adapter/CRUD/Update/Update.cs | 3 ++- Excel_Adapter/CRUD/Update/UpdateWorkbookProperties.cs | 3 ++- Excel_Adapter/Convert/FromExcel/CellContents.cs | 3 ++- Excel_Adapter/ExcelAdapter.cs | 3 ++- Excel_Adapter/Validation/Enums/WorksheetValidation.cs | 3 ++- Excel_Adapter/Validation/WorksheetName.cs | 3 ++- Excel_Engine/Compute/ListToText.cs | 3 ++- Excel_Engine/Convert/ToExcel/CellAddress.cs | 3 ++- Excel_Engine/Convert/ToExcel/CellRange.cs | 3 ++- Excel_Engine/Create/CellAddress.cs | 3 ++- Excel_Engine/Create/CellContentsRequest.cs | 3 ++- Excel_Engine/Create/CellRange.cs | 3 ++- Excel_Engine/Create/CellValuesRequest.cs | 3 ++- Excel_Engine/Create/ExcelPushConfig.cs | 3 ++- Excel_Engine/Create/ObjectRequest.cs | 3 ++- Excel_Engine/Query/ColumnName.cs | 3 ++- Excel_Engine/Query/ExcelToolkitWiki.cs | 5 +++-- Excel_Engine/Query/IsValid.cs | 3 ++- Excel_oM/Address/CellAddress.cs | 3 ++- Excel_oM/Address/CellRange.cs | 3 ++- Excel_oM/ClosedXML/CellContents.cs | 3 ++- Excel_oM/ClosedXML/WorkbookProperties.cs | 3 ++- Excel_oM/Config/ExcelPushConfig.cs | 3 ++- Excel_oM/Requests/CellContentsRequest.cs | 3 ++- Excel_oM/Requests/CellValuesRequest.cs | 3 ++- Excel_oM/Requests/ObjectRequest.cs | 3 ++- Excel_oM/Requests/WorksheetsRequest.cs | 5 +++-- Excel_oM/TableRow.cs | 3 ++- Excel_oM/Worksheet.cs | 5 +++-- 34 files changed, 71 insertions(+), 37 deletions(-) diff --git a/Excel_Adapter/AdapterActions/Pull.cs b/Excel_Adapter/AdapterActions/Pull.cs index 07159ee..bd27b68 100644 --- a/Excel_Adapter/AdapterActions/Pull.cs +++ b/Excel_Adapter/AdapterActions/Pull.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -58,3 +58,4 @@ public override IEnumerable Pull(IRequest request = null, PullType pullO + diff --git a/Excel_Adapter/AdapterActions/Push.cs b/Excel_Adapter/AdapterActions/Push.cs index ec090d5..fad0467 100644 --- a/Excel_Adapter/AdapterActions/Push.cs +++ b/Excel_Adapter/AdapterActions/Push.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -312,3 +312,4 @@ private static void GetPropertyDictionary(ref Dictionary dict, o + diff --git a/Excel_Adapter/CRUD/Create/Create.cs b/Excel_Adapter/CRUD/Create/Create.cs index 6b3321a..28cc015 100644 --- a/Excel_Adapter/CRUD/Create/Create.cs +++ b/Excel_Adapter/CRUD/Create/Create.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -68,3 +68,4 @@ private bool Create(IXLWorkbook workbook, string sheetName, List data, /***************************************************/ } } + diff --git a/Excel_Adapter/CRUD/Delete/Delete.cs b/Excel_Adapter/CRUD/Delete/Delete.cs index 6276854..73ac180 100644 --- a/Excel_Adapter/CRUD/Delete/Delete.cs +++ b/Excel_Adapter/CRUD/Delete/Delete.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -53,3 +53,4 @@ private bool Delete(IXLWorkbook workbook, string sheetName) + diff --git a/Excel_Adapter/CRUD/Read/Read.cs b/Excel_Adapter/CRUD/Read/Read.cs index 0b4638b..178c579 100644 --- a/Excel_Adapter/CRUD/Read/Read.cs +++ b/Excel_Adapter/CRUD/Read/Read.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -314,3 +314,4 @@ private string ConvertToColumnName(int number) + diff --git a/Excel_Adapter/CRUD/Update/Update.cs b/Excel_Adapter/CRUD/Update/Update.cs index 59cea76..c797062 100644 --- a/Excel_Adapter/CRUD/Update/Update.cs +++ b/Excel_Adapter/CRUD/Update/Update.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -70,3 +70,4 @@ public bool Update(IXLWorkbook workbook, string sheetName, List data, + diff --git a/Excel_Adapter/CRUD/Update/UpdateWorkbookProperties.cs b/Excel_Adapter/CRUD/Update/UpdateWorkbookProperties.cs index 28e19a6..284491d 100644 --- a/Excel_Adapter/CRUD/Update/UpdateWorkbookProperties.cs +++ b/Excel_Adapter/CRUD/Update/UpdateWorkbookProperties.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -66,3 +66,4 @@ public void Update(IXLWorkbook workbook, WorkbookProperties properties) + diff --git a/Excel_Adapter/Convert/FromExcel/CellContents.cs b/Excel_Adapter/Convert/FromExcel/CellContents.cs index 45a4dfb..4684e52 100644 --- a/Excel_Adapter/Convert/FromExcel/CellContents.cs +++ b/Excel_Adapter/Convert/FromExcel/CellContents.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -105,3 +105,4 @@ private static Type SystemType(this XLDataType dataType) } + diff --git a/Excel_Adapter/ExcelAdapter.cs b/Excel_Adapter/ExcelAdapter.cs index 740775b..7dcede5 100644 --- a/Excel_Adapter/ExcelAdapter.cs +++ b/Excel_Adapter/ExcelAdapter.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -149,3 +149,4 @@ private void VerifySecurityEvidenceForIsolatedStorage(Assembly assembly) } } + diff --git a/Excel_Adapter/Validation/Enums/WorksheetValidation.cs b/Excel_Adapter/Validation/Enums/WorksheetValidation.cs index 2b0a02c..cb4bf6c 100644 --- a/Excel_Adapter/Validation/Enums/WorksheetValidation.cs +++ b/Excel_Adapter/Validation/Enums/WorksheetValidation.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -34,3 +34,4 @@ public enum WorksheetValidation } } + diff --git a/Excel_Adapter/Validation/WorksheetName.cs b/Excel_Adapter/Validation/WorksheetName.cs index b70185f..f926793 100644 --- a/Excel_Adapter/Validation/WorksheetName.cs +++ b/Excel_Adapter/Validation/WorksheetName.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -193,3 +193,4 @@ private static string TrimName(string worksheetName) } } + diff --git a/Excel_Engine/Compute/ListToText.cs b/Excel_Engine/Compute/ListToText.cs index 4d3b041..4c0a72c 100644 --- a/Excel_Engine/Compute/ListToText.cs +++ b/Excel_Engine/Compute/ListToText.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -51,3 +51,4 @@ public static string ListToText(List objects, string delimiter=",") } + diff --git a/Excel_Engine/Convert/ToExcel/CellAddress.cs b/Excel_Engine/Convert/ToExcel/CellAddress.cs index 6b866f0..32d7287 100644 --- a/Excel_Engine/Convert/ToExcel/CellAddress.cs +++ b/Excel_Engine/Convert/ToExcel/CellAddress.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -48,3 +48,4 @@ public static string ToExcel(this CellAddress bhomAddress) } + diff --git a/Excel_Engine/Convert/ToExcel/CellRange.cs b/Excel_Engine/Convert/ToExcel/CellRange.cs index 467166e..c071b2f 100644 --- a/Excel_Engine/Convert/ToExcel/CellRange.cs +++ b/Excel_Engine/Convert/ToExcel/CellRange.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -48,3 +48,4 @@ public static string ToExcel(this CellRange bhomRange) } + diff --git a/Excel_Engine/Create/CellAddress.cs b/Excel_Engine/Create/CellAddress.cs index 9dfbbc7..de7d3d9 100644 --- a/Excel_Engine/Create/CellAddress.cs +++ b/Excel_Engine/Create/CellAddress.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -59,3 +59,4 @@ public static CellAddress CellAddress(string excelAddress) } + diff --git a/Excel_Engine/Create/CellContentsRequest.cs b/Excel_Engine/Create/CellContentsRequest.cs index 544d85a..bc2cf83 100644 --- a/Excel_Engine/Create/CellContentsRequest.cs +++ b/Excel_Engine/Create/CellContentsRequest.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -54,3 +54,4 @@ public static CellContentsRequest CellContentsRequest(string worksheet, string r } + diff --git a/Excel_Engine/Create/CellRange.cs b/Excel_Engine/Create/CellRange.cs index 504742e..a4782ae 100644 --- a/Excel_Engine/Create/CellRange.cs +++ b/Excel_Engine/Create/CellRange.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -61,3 +61,4 @@ public static CellRange CellRange(string excelRange) } + diff --git a/Excel_Engine/Create/CellValuesRequest.cs b/Excel_Engine/Create/CellValuesRequest.cs index 1514932..15c5baa 100644 --- a/Excel_Engine/Create/CellValuesRequest.cs +++ b/Excel_Engine/Create/CellValuesRequest.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -54,3 +54,4 @@ public static CellValuesRequest CellValuesRequest(string worksheet = "", string } + diff --git a/Excel_Engine/Create/ExcelPushConfig.cs b/Excel_Engine/Create/ExcelPushConfig.cs index f9de97a..dec833c 100644 --- a/Excel_Engine/Create/ExcelPushConfig.cs +++ b/Excel_Engine/Create/ExcelPushConfig.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -58,3 +58,4 @@ public static ExcelPushConfig ExcelPushConfig(string sheetName = "", string star } + diff --git a/Excel_Engine/Create/ObjectRequest.cs b/Excel_Engine/Create/ObjectRequest.cs index 528cde8..2da8be3 100644 --- a/Excel_Engine/Create/ObjectRequest.cs +++ b/Excel_Engine/Create/ObjectRequest.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -60,3 +60,4 @@ public static ObjectRequest ObjectRequest(string worksheet = "", string range = } + diff --git a/Excel_Engine/Query/ColumnName.cs b/Excel_Engine/Query/ColumnName.cs index 624baff..96607ca 100644 --- a/Excel_Engine/Query/ColumnName.cs +++ b/Excel_Engine/Query/ColumnName.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -60,3 +60,4 @@ public static string ColumnName(this int columnIndex) } + diff --git a/Excel_Engine/Query/ExcelToolkitWiki.cs b/Excel_Engine/Query/ExcelToolkitWiki.cs index 65f60e0..1d1f747 100644 --- a/Excel_Engine/Query/ExcelToolkitWiki.cs +++ b/Excel_Engine/Query/ExcelToolkitWiki.cs @@ -1,6 +1,6 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -55,3 +55,4 @@ public static string ExcelToolkitWiki(string page = null) } + diff --git a/Excel_Engine/Query/IsValid.cs b/Excel_Engine/Query/IsValid.cs index 048a436..05bb9a2 100644 --- a/Excel_Engine/Query/IsValid.cs +++ b/Excel_Engine/Query/IsValid.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -168,3 +168,4 @@ public static bool IsValidRange(this string range) } + diff --git a/Excel_oM/Address/CellAddress.cs b/Excel_oM/Address/CellAddress.cs index 175c762..e481d16 100644 --- a/Excel_oM/Address/CellAddress.cs +++ b/Excel_oM/Address/CellAddress.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -43,3 +43,4 @@ public class CellAddress : IObject } + diff --git a/Excel_oM/Address/CellRange.cs b/Excel_oM/Address/CellRange.cs index 16746e4..23f13b6 100644 --- a/Excel_oM/Address/CellRange.cs +++ b/Excel_oM/Address/CellRange.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -43,3 +43,4 @@ public class CellRange : IObject } + diff --git a/Excel_oM/ClosedXML/CellContents.cs b/Excel_oM/ClosedXML/CellContents.cs index 6205d05..0238a85 100644 --- a/Excel_oM/ClosedXML/CellContents.cs +++ b/Excel_oM/ClosedXML/CellContents.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -63,3 +63,4 @@ public class CellContents : BHoMObject + diff --git a/Excel_oM/ClosedXML/WorkbookProperties.cs b/Excel_oM/ClosedXML/WorkbookProperties.cs index 15c7515..4df2030 100644 --- a/Excel_oM/ClosedXML/WorkbookProperties.cs +++ b/Excel_oM/ClosedXML/WorkbookProperties.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -69,3 +69,4 @@ public class WorkbookProperties : BHoMObject + diff --git a/Excel_oM/Config/ExcelPushConfig.cs b/Excel_oM/Config/ExcelPushConfig.cs index 0f008cd..1425751 100644 --- a/Excel_oM/Config/ExcelPushConfig.cs +++ b/Excel_oM/Config/ExcelPushConfig.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -63,3 +63,4 @@ public class ExcelPushConfig : ActionConfig + diff --git a/Excel_oM/Requests/CellContentsRequest.cs b/Excel_oM/Requests/CellContentsRequest.cs index 3b2bc10..c6b1d30 100644 --- a/Excel_oM/Requests/CellContentsRequest.cs +++ b/Excel_oM/Requests/CellContentsRequest.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -47,3 +47,4 @@ public class CellContentsRequest : IRequest + diff --git a/Excel_oM/Requests/CellValuesRequest.cs b/Excel_oM/Requests/CellValuesRequest.cs index 7bfdf56..e3f9ce6 100644 --- a/Excel_oM/Requests/CellValuesRequest.cs +++ b/Excel_oM/Requests/CellValuesRequest.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -45,3 +45,4 @@ public class CellValuesRequest : IRequest + diff --git a/Excel_oM/Requests/ObjectRequest.cs b/Excel_oM/Requests/ObjectRequest.cs index f8a6d37..1d54cb0 100644 --- a/Excel_oM/Requests/ObjectRequest.cs +++ b/Excel_oM/Requests/ObjectRequest.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -50,3 +50,4 @@ public class ObjectRequest : IRequest + diff --git a/Excel_oM/Requests/WorksheetsRequest.cs b/Excel_oM/Requests/WorksheetsRequest.cs index 1e96cf0..c0e0aea 100644 --- a/Excel_oM/Requests/WorksheetsRequest.cs +++ b/Excel_oM/Requests/WorksheetsRequest.cs @@ -1,6 +1,6 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -38,3 +38,4 @@ public class WorksheetsRequest : IRequest } } + diff --git a/Excel_oM/TableRow.cs b/Excel_oM/TableRow.cs index f5c79bf..905c7c8 100644 --- a/Excel_oM/TableRow.cs +++ b/Excel_oM/TableRow.cs @@ -1,6 +1,6 @@ /* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -32,3 +32,4 @@ public class TableRow : BHoMObject } } + diff --git a/Excel_oM/Worksheet.cs b/Excel_oM/Worksheet.cs index 6452a3d..0c618e0 100644 --- a/Excel_oM/Worksheet.cs +++ b/Excel_oM/Worksheet.cs @@ -1,6 +1,6 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * * Each contributor holds copyright over their respective contributions. * The project versioning (Git) records all such contribution source information. @@ -32,3 +32,4 @@ public class Worksheet : BHoMObject } } + From be7c74f3efbc137e88160a118183eddc716e2f1c Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Wed, 3 Jan 2024 17:26:02 +0000 Subject: [PATCH 03/10] Update readme link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b180fa..277312a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository can be used to create brand new BHoM Toolkits :rocket: ## Getting started and templates -Learn how to [rapidly set up your development environment for BHoM here](https://github.com/BHoM/documentation/wiki/Getting-started-for-developers). +Learn how to [rapidly Getting Started for Developers](https://bhom.xyz/documentation/Guides-and-Tutorials/Coding-with-BHoM/). Also, **Visual Studio templates**! :rocket: From 94c91325071370a930a214a28f67c0656869308b Mon Sep 17 00:00:00 2001 From: adecler Date: Tue, 9 Jan 2024 10:02:39 +0000 Subject: [PATCH 04/10] Add ability to push multiple tables without reopening the file every time --- Excel_Adapter/AdapterActions/Push.cs | 102 +++++++++++++++++++-------- Excel_oM/PushItem.cs | 37 ++++++++++ 2 files changed, 110 insertions(+), 29 deletions(-) create mode 100644 Excel_oM/PushItem.cs diff --git a/Excel_Adapter/AdapterActions/Push.cs b/Excel_Adapter/AdapterActions/Push.cs index fad0467..90e8652 100644 --- a/Excel_Adapter/AdapterActions/Push.cs +++ b/Excel_Adapter/AdapterActions/Push.cs @@ -30,6 +30,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics.Eventing.Reader; using System.IO; using System.Linq; @@ -64,7 +65,7 @@ public override List Push(IEnumerable objects, string tag = "", // Cast action config to ExcelPushConfig, create new if null. ExcelPushConfig config = actionConfig as ExcelPushConfig; - if (config == null) + if (config == null && !(objects.FirstOrDefault() is PushItem)) { BH.Engine.Base.Compute.RecordNote($"{nameof(ExcelPushConfig)} has not been provided, default config is used."); config = new ExcelPushConfig(); @@ -93,6 +94,74 @@ public override List Push(IEnumerable objects, string tag = "", return new List(); } + // Push the objects + List pushedObjects = new List(); + if (objects.FirstOrDefault() is PushItem) + { + foreach (PushItem item in objects.OfType()) + { + if (PushObjects(workbook, item.Objects, item.Config, pushType)) + pushedObjects.AddRange(item.Objects); + } + } + else + { + if (PushObjects(workbook, objects.ToList(), config, pushType)) + pushedObjects = objects.ToList(); + } + + // Try to update the workbook properties and then save it. + try + { + if (config != null) + Update(workbook, config.WorkbookProperties); + + if (m_FileSettings != null) + workbook.SaveAs(m_FileSettings.GetFullFileName()); + else if (m_OutputStream != null) + { + workbook.SaveAs(m_OutputStream); + m_OutputStream.Position = 0; + } + else + { + BH.Engine.Base.Compute.RecordError("Output stream has not been provided. The workbook cannot be saved."); + return new List(); + } + + return pushedObjects; + } + catch (Exception e) + { + BH.Engine.Base.Compute.RecordError($"Finalisation and saving of the workbook failed with the following error: {e.Message}"); + return new List(); + } + } + + /***************************************************/ + /**** Private Methods ****/ + /***************************************************/ + + private bool PushObjects(XLWorkbook workbook, List objects, ExcelPushConfig config, PushType pushType = PushType.AdapterDefault) + { + // Makwe sure the config is defined + if (config == null) + { + BH.Engine.Base.Compute.RecordNote($"{nameof(ExcelPushConfig)} has not been provided, default config is used."); + config = new ExcelPushConfig(); + } + + // Make sure that a single type of objects are pushed + List objectTypes = objects.Select(x => x.GetType()).Distinct().ToList(); + if (objectTypes.Count != 1) + { + string message = "The Excel adapter only allows to push objects of a single type per table." + + "\nRight now you are providing objects of the following types: " + + objectTypes.Select(x => x.ToString()).Aggregate((a, b) => a + ", " + b); + Engine.Base.Compute.RecordError(message); + return false; + } + // Split the tables into collections to delete, create and update. bool success = true; string sheetName = config.Worksheet; @@ -134,39 +203,14 @@ public override List Push(IEnumerable objects, string tag = "", default: { BH.Engine.Base.Compute.RecordError($"Currently Excel adapter does not supports {nameof(PushType)} equal to {pushType}"); - return new List(); + return false; } } - // Try to update the workbook properties and then save it. - try - { - Update(workbook, config.WorkbookProperties); - - if (m_FileSettings != null) - workbook.SaveAs(m_FileSettings.GetFullFileName()); - else if (m_OutputStream != null) - { - workbook.SaveAs(m_OutputStream); - m_OutputStream.Position = 0; - } - else - { - BH.Engine.Base.Compute.RecordError("Output stream has not been provided. The workbook cannot be saved."); - return new List(); - } - - return success ? objects.ToList() : new List(); - } - catch (Exception e) - { - BH.Engine.Base.Compute.RecordError($"Finalisation and saving of the workbook failed with the following error: {e.Message}"); - return new List(); - } + return success; } - /***************************************************/ - /**** Private Methods ****/ + /***************************************************/ private XLWorkbook CreateWorkbookFromFile(string fileName, PushType pushType) diff --git a/Excel_oM/PushItem.cs b/Excel_oM/PushItem.cs new file mode 100644 index 0000000..1e6afb2 --- /dev/null +++ b/Excel_oM/PushItem.cs @@ -0,0 +1,37 @@ +/* + * This file is part of the Buildings and Habitats object Model (BHoM) + * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. + * + * Each contributor holds copyright over their respective contributions. + * The project versioning (Git) records all such contribution source information. + * + * + * The BHoM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3.0 of the License, or + * (at your option) any later version. + * + * The BHoM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this code. If not, see . + */ + +using BH.oM.Base; +using BH.oM.Base.Attributes; +using System.Collections.Generic; + +namespace BH.oM.Adapters.Excel +{ + public class PushItem : BHoMObject + { + public virtual List Objects { get; set; } = new List(); + + public virtual ExcelPushConfig Config { get; set; } = new ExcelPushConfig(); + } +} + + From d0c5cae47c6f24848713e0ebc7ce3312a6c35846 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Mon, 15 Jan 2024 20:23:10 +0000 Subject: [PATCH 05/10] Remove unnecessary using which is preventing ZeroCodeTool build --- Excel_Adapter/AdapterActions/Push.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Excel_Adapter/AdapterActions/Push.cs b/Excel_Adapter/AdapterActions/Push.cs index 90e8652..44f9bbf 100644 --- a/Excel_Adapter/AdapterActions/Push.cs +++ b/Excel_Adapter/AdapterActions/Push.cs @@ -30,7 +30,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Diagnostics.Eventing.Reader; using System.IO; using System.Linq; From e821ec22471d8935f122f591d1af52a4942d9281 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Mon, 15 Jan 2024 20:24:38 +0000 Subject: [PATCH 06/10] Add altConfigs to ensure check core checks default and zerocodetools --- altConfigs.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 altConfigs.txt diff --git a/altConfigs.txt b/altConfigs.txt new file mode 100644 index 0000000..2c21bef --- /dev/null +++ b/altConfigs.txt @@ -0,0 +1 @@ +BHoM/Excel_Toolkit/ZeroCodeTool \ No newline at end of file From ad157a94ebe37d165d312db7c819041d731179cf Mon Sep 17 00:00:00 2001 From: travispotterBH Date: Wed, 17 Jan 2024 11:20:40 -0500 Subject: [PATCH 07/10] Update Nuget pacakages --- Excel_Adapter/Excel_Adapter.csproj | 18 +++++++++++++----- Excel_Adapter/packages.config | 11 ++++++----- Excel_oM/packages.config | 6 +++--- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Excel_Adapter/Excel_Adapter.csproj b/Excel_Adapter/Excel_Adapter.csproj index 7793263..f63920e 100644 --- a/Excel_Adapter/Excel_Adapter.csproj +++ b/Excel_Adapter/Excel_Adapter.csproj @@ -23,7 +23,7 @@ - + @@ -82,14 +82,22 @@ - - + + + - + + + + - + + + + + diff --git a/Excel_Adapter/packages.config b/Excel_Adapter/packages.config index a4c20c7..36d47dd 100644 --- a/Excel_Adapter/packages.config +++ b/Excel_Adapter/packages.config @@ -1,9 +1,10 @@  - - - + + + - - + + + \ No newline at end of file diff --git a/Excel_oM/packages.config b/Excel_oM/packages.config index 0d0618f..b15aea1 100644 --- a/Excel_oM/packages.config +++ b/Excel_oM/packages.config @@ -1,6 +1,6 @@  - - - + + + \ No newline at end of file From 502a7529ffd524684e5da5576508e881da300f20 Mon Sep 17 00:00:00 2001 From: travispotterBH Date: Wed, 17 Jan 2024 11:20:47 -0500 Subject: [PATCH 08/10] Fix compile Errors --- Excel_Adapter/Convert/FromExcel/CellContents.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Excel_Adapter/Convert/FromExcel/CellContents.cs b/Excel_Adapter/Convert/FromExcel/CellContents.cs index 4684e52..d955ebb 100644 --- a/Excel_Adapter/Convert/FromExcel/CellContents.cs +++ b/Excel_Adapter/Convert/FromExcel/CellContents.cs @@ -44,14 +44,14 @@ public static CellContents FromExcel(this IXLCell xLCell) return new CellContents() { - Comment = xLCell.HasComment ? xLCell.Comment.Text : "", + Comment = xLCell.HasComment ? xLCell.GetComment().Text : "", Value = xLCell.CellValueOrCachedValue(), Address = BH.Engine.Excel.Create.CellAddress(xLCell.Address.ToString()), DataType = xLCell.DataType.SystemType(), FormulaA1 = xLCell.FormulaA1, FormulaR1C1 = xLCell.FormulaR1C1, - HyperLink = xLCell.HasHyperlink ? xLCell.Hyperlink.ExternalAddress.ToString() : "", - RichText = xLCell.HasRichText ? xLCell.RichText.Text : "" + HyperLink = xLCell.HasHyperlink ? xLCell.GetHyperlink().ExternalAddress.ToString() : "", + RichText = xLCell.HasRichText ? xLCell.GetRichText().Text : "" }; @@ -62,10 +62,10 @@ public static CellContents FromExcel(this IXLCell xLCell) [Description("Gets the value of the cell, or cached value if the TryGetValue method fails. Raises a warning if the cached value is used, and ClosedXML beleives the cell needs to be recalculated.")] [Input("xLCell", "IXLCell to get the (cached) value from.")] [Input("value", "Value or cached value of the cell.")] - public static object CellValueOrCachedValue(this IXLCell xLCell) + public static object CellValueOrCachedValue(this IXLCell xLCell) { object value; - if (!xLCell.TryGetValue(out value)) + if (!xLCell.TryGetValue(out value)) { //If not able to just get the value, then get the cached value //If cell is flagged as needing recalculation, raise warning. From 03dc44e15a2cdce92d472fde5a52515150c318bc Mon Sep 17 00:00:00 2001 From: Thomas Edward Kingstone Date: Mon, 18 Mar 2024 12:59:40 +0000 Subject: [PATCH 09/10] fixed post build events --- Excel_Adapter/Excel_Adapter.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Excel_Adapter/Excel_Adapter.csproj b/Excel_Adapter/Excel_Adapter.csproj index f63920e..95d58cf 100644 --- a/Excel_Adapter/Excel_Adapter.csproj +++ b/Excel_Adapter/Excel_Adapter.csproj @@ -23,7 +23,7 @@ - + From 492d6b7f5baa640968970c502237c6128608701b Mon Sep 17 00:00:00 2001 From: travispotterBH Date: Thu, 21 Mar 2024 13:27:43 -0400 Subject: [PATCH 10/10] Update Excel_Adapter.csproj --- Excel_Adapter/Excel_Adapter.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Excel_Adapter/Excel_Adapter.csproj b/Excel_Adapter/Excel_Adapter.csproj index 95d58cf..4a755d7 100644 --- a/Excel_Adapter/Excel_Adapter.csproj +++ b/Excel_Adapter/Excel_Adapter.csproj @@ -87,7 +87,7 @@ - +