@nfdi4plants/arctrl 1.0.0-alpha6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCtrl.js +257 -0
- package/Contract/Contract.js +95 -0
- package/Contracts/Contracts.ARCtrl.js +35 -0
- package/Contracts/Contracts.ArcAssay.js +65 -0
- package/Contracts/Contracts.ArcInvestigation.js +58 -0
- package/Contracts/Contracts.ArcStudy.js +65 -0
- package/Contracts/Contracts.Git.js +91 -0
- package/FileSystem/Commit.js +18 -0
- package/FileSystem/DefaultGitignore.js +3 -0
- package/FileSystem/FileSystem.js +53 -0
- package/FileSystem/FileSystemTree.js +223 -0
- package/FileSystem/Path.js +38 -0
- package/FileSystemTree.js +51 -0
- package/ISA/ISA/ArcTypes/ArcTable.js +744 -0
- package/ISA/ISA/ArcTypes/ArcTableAux.js +1142 -0
- package/ISA/ISA/ArcTypes/ArcTables.js +380 -0
- package/ISA/ISA/ArcTypes/ArcTypes.js +2018 -0
- package/ISA/ISA/ArcTypes/CompositeCell.js +180 -0
- package/ISA/ISA/ArcTypes/CompositeColumn.js +42 -0
- package/ISA/ISA/ArcTypes/CompositeHeader.js +358 -0
- package/ISA/ISA/ArcTypes/CompositeRow.js +111 -0
- package/ISA/ISA/ArcTypes/IdentifierSetters.js +26 -0
- package/ISA/ISA/Builder/Types.js +243 -0
- package/ISA/ISA/Fable.js +50 -0
- package/ISA/ISA/Helper.js +326 -0
- package/ISA/ISA/Identifier.js +76 -0
- package/ISA/ISA/JsonTypes/AnnotationValue.js +56 -0
- package/ISA/ISA/JsonTypes/Assay.js +620 -0
- package/ISA/ISA/JsonTypes/AssayMaterials.js +39 -0
- package/ISA/ISA/JsonTypes/ColumnIndex.js +246 -0
- package/ISA/ISA/JsonTypes/Comment.js +58 -0
- package/ISA/ISA/JsonTypes/CommentList.js +139 -0
- package/ISA/ISA/JsonTypes/Component.js +158 -0
- package/ISA/ISA/JsonTypes/Data.js +55 -0
- package/ISA/ISA/JsonTypes/DataFile.js +68 -0
- package/ISA/ISA/JsonTypes/Factor.js +128 -0
- package/ISA/ISA/JsonTypes/FactorValue.js +109 -0
- package/ISA/ISA/JsonTypes/Investigation.js +204 -0
- package/ISA/ISA/JsonTypes/Material.js +66 -0
- package/ISA/ISA/JsonTypes/MaterialAttribute.js +101 -0
- package/ISA/ISA/JsonTypes/MaterialAttributeValue.js +126 -0
- package/ISA/ISA/JsonTypes/MaterialType.js +41 -0
- package/ISA/ISA/JsonTypes/OntologyAnnotation.js +219 -0
- package/ISA/ISA/JsonTypes/OntologySourceReference.js +85 -0
- package/ISA/ISA/JsonTypes/Person.js +137 -0
- package/ISA/ISA/JsonTypes/Process.js +401 -0
- package/ISA/ISA/JsonTypes/ProcessInput.js +297 -0
- package/ISA/ISA/JsonTypes/ProcessOutput.js +263 -0
- package/ISA/ISA/JsonTypes/ProcessParameterValue.js +129 -0
- package/ISA/ISA/JsonTypes/ProcessSequence.js +255 -0
- package/ISA/ISA/JsonTypes/Protocol.js +277 -0
- package/ISA/ISA/JsonTypes/ProtocolParameter.js +101 -0
- package/ISA/ISA/JsonTypes/Publication.js +105 -0
- package/ISA/ISA/JsonTypes/Sample.js +71 -0
- package/ISA/ISA/JsonTypes/Source.js +54 -0
- package/ISA/ISA/JsonTypes/Study.js +942 -0
- package/ISA/ISA/JsonTypes/StudyMaterials.js +45 -0
- package/ISA/ISA/JsonTypes/URI.js +19 -0
- package/ISA/ISA/JsonTypes/Value.js +210 -0
- package/ISA/ISA/Regex.js +588 -0
- package/ISA/ISA.Json/Assay.js +123 -0
- package/ISA/ISA.Json/Comment.js +84 -0
- package/ISA/ISA.Json/ConverterOptions.js +33 -0
- package/ISA/ISA.Json/Data.js +271 -0
- package/ISA/ISA.Json/Decode.js +46 -0
- package/ISA/ISA.Json/Factor.js +194 -0
- package/ISA/ISA.Json/GEncode.js +15 -0
- package/ISA/ISA.Json/Investigation.js +132 -0
- package/ISA/ISA.Json/Material.js +233 -0
- package/ISA/ISA.Json/Ontology.js +204 -0
- package/ISA/ISA.Json/Person.js +204 -0
- package/ISA/ISA.Json/Process.js +291 -0
- package/ISA/ISA.Json/Protocol.js +242 -0
- package/ISA/ISA.Json/Publication.js +92 -0
- package/ISA/ISA.Json/Study.js +230 -0
- package/ISA/ISA.Json/Validation/Fable.js +69 -0
- package/ISA/ISA.Json/Validation/JsonSchemaValidation.js +88 -0
- package/ISA/ISA.Json/Validation/ValidationResult.js +45 -0
- package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +137 -0
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +78 -0
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +59 -0
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +478 -0
- package/ISA/ISA.Spreadsheet/ArcAssay.js +150 -0
- package/ISA/ISA.Spreadsheet/ArcInvestigation.js +314 -0
- package/ISA/ISA.Spreadsheet/ArcStudy.js +67 -0
- package/ISA/ISA.Spreadsheet/CollectionAux.js +128 -0
- package/ISA/ISA.Spreadsheet/Metadata/Assays.js +81 -0
- package/ISA/ISA.Spreadsheet/Metadata/Comment.js +60 -0
- package/ISA/ISA.Spreadsheet/Metadata/Contacts.js +104 -0
- package/ISA/ISA.Spreadsheet/Metadata/Conversions.js +180 -0
- package/ISA/ISA.Spreadsheet/Metadata/DesignDescriptors.js +27 -0
- package/ISA/ISA.Spreadsheet/Metadata/Factors.js +85 -0
- package/ISA/ISA.Spreadsheet/Metadata/OntologyAnnotation.js +65 -0
- package/ISA/ISA.Spreadsheet/Metadata/OntologySourceReference.js +73 -0
- package/ISA/ISA.Spreadsheet/Metadata/Protocols.js +116 -0
- package/ISA/ISA.Spreadsheet/Metadata/Publication.js +96 -0
- package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +451 -0
- package/ISA/ISA.Spreadsheet/Metadata/Study.js +260 -0
- package/README.md +277 -0
- package/SemVer.js +60 -0
- package/Templates/Templates.Json.js +40 -0
- package/Templates/Templates.Spreadsheet.js +315 -0
- package/Templates/Templates.js +179 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs +387 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs.js +240 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCellsCollection.fs +725 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCellsCollection.fs.js +522 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/CellBuilder.fs +195 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/CellBuilder.fs.js +208 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/ColumnBuilder.fs +209 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/ColumnBuilder.fs.js +137 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/DSL.fs +61 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/DSL.fs.js +62 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Expression.fs +24 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Expression.fs.js +56 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Operators.fs +102 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Operators.fs.js +6 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/RowBuilder.fs +200 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/RowBuilder.fs.js +137 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/SheetBuilder.fs +139 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/SheetBuilder.fs.js +116 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/TableBuilder.fs +120 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/TableBuilder.fs.js +120 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Transform.fs +229 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Transform.fs.js +421 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Types.fs +151 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Types.fs.js +277 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/WorkbookBuilder.fs +114 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/WorkbookBuilder.fs.js +104 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsAddress.fs +177 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsAddress.fs.js +249 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsColumn.fs +200 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsColumn.fs.js +125 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsRow.fs +202 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsRow.fs.js +135 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsSpreadsheet.fableproj +58 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsWorkbook.fs +183 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsWorkbook.fs.js +138 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsWorksheet.fs +628 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsWorksheet.fs.js +398 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRange.fs +19 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRange.fs.js +41 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeAddress.fs +222 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeAddress.fs.js +235 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeBase.fs +93 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeBase.fs.js +91 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeColumn.fs +65 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeColumn.fs.js +74 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeRow.fs +22 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeRow.fs.js +40 -0
- package/fable_modules/FsSpreadsheet.4.1.0/SheetBuilder.fs +249 -0
- package/fable_modules/FsSpreadsheet.4.1.0/SheetBuilder.fs.js +325 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTable.fs +455 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTable.fs.js +310 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableField.fs +140 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableField.fs.js +173 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableRow.fs +6 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableRow.fs.js +17 -0
- package/fable_modules/FsSpreadsheet.4.1.0/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
- package/fable_modules/FsSpreadsheet.4.1.0/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +19 -0
- package/fable_modules/FsSpreadsheet.4.1.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
- package/fable_modules/FsSpreadsheet.4.1.0/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +19 -0
- package/fable_modules/Thoth.Json.10.1.0/Decode.fs +1366 -0
- package/fable_modules/Thoth.Json.10.1.0/Decode.fs.js +1798 -0
- package/fable_modules/Thoth.Json.10.1.0/Encode.fs +621 -0
- package/fable_modules/Thoth.Json.10.1.0/Encode.fs.js +472 -0
- package/fable_modules/Thoth.Json.10.1.0/Extra.fs +31 -0
- package/fable_modules/Thoth.Json.10.1.0/Extra.fs.js +8 -0
- package/fable_modules/Thoth.Json.10.1.0/Thoth.Json.fableproj +30 -0
- package/fable_modules/Thoth.Json.10.1.0/Types.fs +59 -0
- package/fable_modules/Thoth.Json.10.1.0/Types.fs.js +98 -0
- package/fable_modules/Thoth.Json.10.1.0/obj/Release/netstandard2.0/Thoth.Json.AssemblyInfo.fs +19 -0
- package/fable_modules/Thoth.Json.10.1.0/package.json +5 -0
- package/fable_modules/fable-library.4.1.4/Array.d.ts +120 -0
- package/fable_modules/fable-library.4.1.4/Array.js +1204 -0
- package/fable_modules/fable-library.4.1.4/Async.d.ts +32 -0
- package/fable_modules/fable-library.4.1.4/Async.js +158 -0
- package/fable_modules/fable-library.4.1.4/AsyncBuilder.d.ts +59 -0
- package/fable_modules/fable-library.4.1.4/AsyncBuilder.js +183 -0
- package/fable_modules/fable-library.4.1.4/BigInt.d.ts +115 -0
- package/fable_modules/fable-library.4.1.4/BigInt.js +282 -0
- package/fable_modules/fable-library.4.1.4/BitConverter.d.ts +27 -0
- package/fable_modules/fable-library.4.1.4/BitConverter.js +138 -0
- package/fable_modules/fable-library.4.1.4/Boolean.d.ts +3 -0
- package/fable_modules/fable-library.4.1.4/Boolean.js +21 -0
- package/fable_modules/fable-library.4.1.4/Char.d.ts +65 -0
- package/fable_modules/fable-library.4.1.4/Char.js +169 -0
- package/fable_modules/fable-library.4.1.4/Choice.d.ts +138 -0
- package/fable_modules/fable-library.4.1.4/Choice.js +227 -0
- package/fable_modules/fable-library.4.1.4/Date.d.ts +70 -0
- package/fable_modules/fable-library.4.1.4/Date.js +451 -0
- package/fable_modules/fable-library.4.1.4/DateOffset.d.ts +63 -0
- package/fable_modules/fable-library.4.1.4/DateOffset.js +268 -0
- package/fable_modules/fable-library.4.1.4/DateOnly.d.ts +18 -0
- package/fable_modules/fable-library.4.1.4/DateOnly.js +124 -0
- package/fable_modules/fable-library.4.1.4/Decimal.d.ts +45 -0
- package/fable_modules/fable-library.4.1.4/Decimal.js +212 -0
- package/fable_modules/fable-library.4.1.4/Double.d.ts +11 -0
- package/fable_modules/fable-library.4.1.4/Double.js +46 -0
- package/fable_modules/fable-library.4.1.4/Encoding.d.ts +12 -0
- package/fable_modules/fable-library.4.1.4/Encoding.js +173 -0
- package/fable_modules/fable-library.4.1.4/Event.d.ts +31 -0
- package/fable_modules/fable-library.4.1.4/Event.js +93 -0
- package/fable_modules/fable-library.4.1.4/FSharp.Collections.d.ts +7 -0
- package/fable_modules/fable-library.4.1.4/FSharp.Collections.js +27 -0
- package/fable_modules/fable-library.4.1.4/FSharp.Core.d.ts +17 -0
- package/fable_modules/fable-library.4.1.4/FSharp.Core.js +69 -0
- package/fable_modules/fable-library.4.1.4/Global.d.ts +24 -0
- package/fable_modules/fable-library.4.1.4/Global.js +8 -0
- package/fable_modules/fable-library.4.1.4/Guid.d.ts +10 -0
- package/fable_modules/fable-library.4.1.4/Guid.js +142 -0
- package/fable_modules/fable-library.4.1.4/Int32.d.ts +28 -0
- package/fable_modules/fable-library.4.1.4/Int32.js +135 -0
- package/fable_modules/fable-library.4.1.4/List.d.ts +143 -0
- package/fable_modules/fable-library.4.1.4/List.js +1273 -0
- package/fable_modules/fable-library.4.1.4/Long.d.ts +3 -0
- package/fable_modules/fable-library.4.1.4/Long.js +46 -0
- package/fable_modules/fable-library.4.1.4/MailboxProcessor.d.ts +25 -0
- package/fable_modules/fable-library.4.1.4/MailboxProcessor.js +93 -0
- package/fable_modules/fable-library.4.1.4/Map.d.ts +178 -0
- package/fable_modules/fable-library.4.1.4/Map.js +1396 -0
- package/fable_modules/fable-library.4.1.4/MapUtil.d.ts +10 -0
- package/fable_modules/fable-library.4.1.4/MapUtil.js +112 -0
- package/fable_modules/fable-library.4.1.4/MutableMap.d.ts +52 -0
- package/fable_modules/fable-library.4.1.4/MutableMap.js +326 -0
- package/fable_modules/fable-library.4.1.4/MutableSet.d.ts +39 -0
- package/fable_modules/fable-library.4.1.4/MutableSet.js +232 -0
- package/fable_modules/fable-library.4.1.4/Native.d.ts +2 -0
- package/fable_modules/fable-library.4.1.4/Native.js +8 -0
- package/fable_modules/fable-library.4.1.4/Numeric.d.ts +19 -0
- package/fable_modules/fable-library.4.1.4/Numeric.js +71 -0
- package/fable_modules/fable-library.4.1.4/Observable.d.ts +32 -0
- package/fable_modules/fable-library.4.1.4/Observable.js +113 -0
- package/fable_modules/fable-library.4.1.4/Option.d.ts +28 -0
- package/fable_modules/fable-library.4.1.4/Option.js +96 -0
- package/fable_modules/fable-library.4.1.4/README.md +3 -0
- package/fable_modules/fable-library.4.1.4/Random.d.ts +37 -0
- package/fable_modules/fable-library.4.1.4/Random.js +170 -0
- package/fable_modules/fable-library.4.1.4/Range.d.ts +12 -0
- package/fable_modules/fable-library.4.1.4/Range.js +45 -0
- package/fable_modules/fable-library.4.1.4/Reflection.d.ts +119 -0
- package/fable_modules/fable-library.4.1.4/Reflection.js +461 -0
- package/fable_modules/fable-library.4.1.4/RegExp.d.ts +10 -0
- package/fable_modules/fable-library.4.1.4/RegExp.js +132 -0
- package/fable_modules/fable-library.4.1.4/Seq.d.ts +165 -0
- package/fable_modules/fable-library.4.1.4/Seq.js +1379 -0
- package/fable_modules/fable-library.4.1.4/Seq2.d.ts +18 -0
- package/fable_modules/fable-library.4.1.4/Seq2.js +111 -0
- package/fable_modules/fable-library.4.1.4/Set.d.ts +190 -0
- package/fable_modules/fable-library.4.1.4/Set.js +1789 -0
- package/fable_modules/fable-library.4.1.4/String.d.ts +49 -0
- package/fable_modules/fable-library.4.1.4/String.js +540 -0
- package/fable_modules/fable-library.4.1.4/System.Collections.Generic.d.ts +71 -0
- package/fable_modules/fable-library.4.1.4/System.Collections.Generic.js +307 -0
- package/fable_modules/fable-library.4.1.4/System.Text.d.ts +30 -0
- package/fable_modules/fable-library.4.1.4/System.Text.js +110 -0
- package/fable_modules/fable-library.4.1.4/SystemException.d.ts +5 -0
- package/fable_modules/fable-library.4.1.4/SystemException.js +5 -0
- package/fable_modules/fable-library.4.1.4/TimeOnly.d.ts +15 -0
- package/fable_modules/fable-library.4.1.4/TimeOnly.js +122 -0
- package/fable_modules/fable-library.4.1.4/TimeSpan.d.ts +34 -0
- package/fable_modules/fable-library.4.1.4/TimeSpan.js +177 -0
- package/fable_modules/fable-library.4.1.4/Timer.d.ts +19 -0
- package/fable_modules/fable-library.4.1.4/Timer.js +67 -0
- package/fable_modules/fable-library.4.1.4/Types.d.ts +58 -0
- package/fable_modules/fable-library.4.1.4/Types.js +208 -0
- package/fable_modules/fable-library.4.1.4/Unicode.13.0.0.d.ts +2 -0
- package/fable_modules/fable-library.4.1.4/Unicode.13.0.0.js +4 -0
- package/fable_modules/fable-library.4.1.4/Uri.d.ts +29 -0
- package/fable_modules/fable-library.4.1.4/Uri.js +142 -0
- package/fable_modules/fable-library.4.1.4/Util.d.ts +187 -0
- package/fable_modules/fable-library.4.1.4/Util.js +662 -0
- package/fable_modules/fable-library.4.1.4/lib/big.d.ts +338 -0
- package/fable_modules/fable-library.4.1.4/lib/big.js +826 -0
- package/fable_modules/fable-library.4.1.4/package.json +23 -0
- package/fable_modules/project_cracked.json +1 -0
- package/package.json +22 -0
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
namespace FsSpreadsheet
|
|
2
|
+
|
|
3
|
+
open System.Collections.Generic
|
|
4
|
+
|
|
5
|
+
module Dictionary =
|
|
6
|
+
|
|
7
|
+
let tryGet (k : 'Key) (dict : Dictionary<'Key,'Value>) =
|
|
8
|
+
|
|
9
|
+
if dict.ContainsKey k then
|
|
10
|
+
Some (dict.Item k)
|
|
11
|
+
else None
|
|
12
|
+
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
type FsCellsCollection() =
|
|
17
|
+
|
|
18
|
+
// ---------
|
|
19
|
+
// VARIABLES
|
|
20
|
+
// ---------
|
|
21
|
+
|
|
22
|
+
let mutable _columnsUsed : Dictionary<int32, int32> = new Dictionary<int, int>()
|
|
23
|
+
let mutable _deleted : Dictionary<int32, HashSet<int32>> = new Dictionary<int, HashSet<int>>()
|
|
24
|
+
let mutable _rowsCollection : Dictionary<int, Dictionary<int, FsCell>> = new Dictionary<int, Dictionary<int, FsCell>>()
|
|
25
|
+
|
|
26
|
+
let mutable _maxColumnUsed : int32 = 0
|
|
27
|
+
let mutable _maxRowUsed : int32 = 0
|
|
28
|
+
let mutable _rowsUsed : Dictionary<int32, int32> = new Dictionary<int, int>();
|
|
29
|
+
|
|
30
|
+
let mutable _count = 0
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// ----------
|
|
34
|
+
// PROPERTIES
|
|
35
|
+
// ----------
|
|
36
|
+
|
|
37
|
+
member this.Count
|
|
38
|
+
with get () = _count
|
|
39
|
+
and private set(count) = _count <- count
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
/// The highest rowIndex in The FsCellsCollection.
|
|
43
|
+
/// </summary>
|
|
44
|
+
/// <remarks>Do not confuse with the number of rows in the FsCellsCollection.</remarks>
|
|
45
|
+
member this.MaxRowNumber = _maxRowUsed
|
|
46
|
+
|
|
47
|
+
/// <summary>
|
|
48
|
+
/// The highest columnIndex in The FsCellsCollection.
|
|
49
|
+
/// </summary>
|
|
50
|
+
/// <remarks>Do not confuse with the number of columns in the FsCellsCollection.</remarks>
|
|
51
|
+
member this.MaxColumnNumber = _maxColumnUsed
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
// -------
|
|
55
|
+
// METHODS
|
|
56
|
+
// -------
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
/// Creates a deep copy of the FsCellsCollection.
|
|
60
|
+
/// </summary>
|
|
61
|
+
member this.Copy() =
|
|
62
|
+
let cells = this.GetCells() |> Seq.map (fun (c : FsCell) -> c.Copy())
|
|
63
|
+
FsCellsCollection.createFromCells cells
|
|
64
|
+
|
|
65
|
+
/// <summary>
|
|
66
|
+
/// Returns a deep copy of a given FsCellsCollection.
|
|
67
|
+
/// </summary>
|
|
68
|
+
static member copy (cellsCollection : FsCellsCollection) =
|
|
69
|
+
cellsCollection.Copy()
|
|
70
|
+
|
|
71
|
+
///
|
|
72
|
+
static member private IncrementUsage(dictionary : Dictionary<int, int>, key : int32) =
|
|
73
|
+
|
|
74
|
+
match Dictionary.tryGet key dictionary with
|
|
75
|
+
| Some count ->
|
|
76
|
+
dictionary.[key] <- count + 1
|
|
77
|
+
| None ->
|
|
78
|
+
dictionary.Add(key, 1)
|
|
79
|
+
|
|
80
|
+
///// <summary/>
|
|
81
|
+
///// <returns>True if the number was lowered to zero so MaxColumnUsed or MaxRowUsed may require
|
|
82
|
+
///// recomputation.</returns>
|
|
83
|
+
static member private DecrementUsage(dictionary : Dictionary<int, int>, key : int32) =
|
|
84
|
+
|
|
85
|
+
match Dictionary.tryGet key dictionary with
|
|
86
|
+
| Some count when count > 1 ->
|
|
87
|
+
dictionary.[key] <- count - 1
|
|
88
|
+
false
|
|
89
|
+
| Some _ ->
|
|
90
|
+
dictionary.Remove(key) |> ignore
|
|
91
|
+
true
|
|
92
|
+
| None ->
|
|
93
|
+
false
|
|
94
|
+
|
|
95
|
+
/// <summary>
|
|
96
|
+
/// Creates an FsCellsCollection from the given FsCells.
|
|
97
|
+
/// </summary>
|
|
98
|
+
/// <remarks>Derives row- and columnIndices from the FsAddress of the FsCells.</remarks>
|
|
99
|
+
static member createFromCells (cells : seq<FsCell>) =
|
|
100
|
+
let fcc = FsCellsCollection()
|
|
101
|
+
fcc.Add cells
|
|
102
|
+
fcc
|
|
103
|
+
|
|
104
|
+
// TO DO: Must create deep copy methods for ALL other objects in it first, and call them here.
|
|
105
|
+
///// <summary>Creates and returns a deep copy of the FsCellsCollection.</summary>
|
|
106
|
+
//member this.Copy() =
|
|
107
|
+
// let newCellsColl = FsCellsCollection()
|
|
108
|
+
// let oldCells : seq<FsCell> = this.GetCells()
|
|
109
|
+
// let newCells = // create deep copy here
|
|
110
|
+
// newCellsColl.Add cells
|
|
111
|
+
|
|
112
|
+
///// <summary>
|
|
113
|
+
///// Creates and returns a deep copy of an FsCellsCollection.
|
|
114
|
+
///// </summary>
|
|
115
|
+
//static member copy (cellsCollection : FsCellsCollection) =
|
|
116
|
+
// cellsCollection.Copy()
|
|
117
|
+
|
|
118
|
+
/// <summary>
|
|
119
|
+
/// Empties the whole FsCellsCollection.
|
|
120
|
+
/// </summary>
|
|
121
|
+
member this.Clear() =
|
|
122
|
+
|
|
123
|
+
_count <- 0;
|
|
124
|
+
_rowsUsed.Clear();
|
|
125
|
+
_columnsUsed.Clear();
|
|
126
|
+
|
|
127
|
+
_rowsCollection.Clear();
|
|
128
|
+
_maxRowUsed <- 0;
|
|
129
|
+
_maxColumnUsed <- 0
|
|
130
|
+
|
|
131
|
+
this
|
|
132
|
+
|
|
133
|
+
//public void Add(XLSheetPoint sheetPoint, XLCell cell)
|
|
134
|
+
//{
|
|
135
|
+
// Add(sheetPoint.Row, sheetPoint.Column, cell);
|
|
136
|
+
//}
|
|
137
|
+
|
|
138
|
+
/// <summary>
|
|
139
|
+
/// Adds an FsCell of given rowIndex and columnIndex to the FsCellsCollection.
|
|
140
|
+
/// </summary>
|
|
141
|
+
member this.Add(row : int32, column : int32, cell : FsCell) =
|
|
142
|
+
|
|
143
|
+
cell.RowNumber <- row
|
|
144
|
+
cell.ColumnNumber <- column
|
|
145
|
+
_count <- _count + 1
|
|
146
|
+
|
|
147
|
+
FsCellsCollection.IncrementUsage(_rowsUsed, row);
|
|
148
|
+
FsCellsCollection.IncrementUsage(_columnsUsed, column);
|
|
149
|
+
|
|
150
|
+
let columnsCollection =
|
|
151
|
+
match Dictionary.tryGet row _rowsCollection with
|
|
152
|
+
| Some columnsCollection ->
|
|
153
|
+
columnsCollection
|
|
154
|
+
| None ->
|
|
155
|
+
let columnsCollection = new Dictionary<int, FsCell>();
|
|
156
|
+
_rowsCollection.Add(row, columnsCollection);
|
|
157
|
+
columnsCollection
|
|
158
|
+
|
|
159
|
+
columnsCollection.Add(column, cell);
|
|
160
|
+
if row > _maxRowUsed then _maxRowUsed <- row;
|
|
161
|
+
if column > _maxColumnUsed then _maxColumnUsed <- column;
|
|
162
|
+
|
|
163
|
+
match Dictionary.tryGet row _deleted with
|
|
164
|
+
| Some delHash ->
|
|
165
|
+
delHash.Remove(column) |> ignore
|
|
166
|
+
| None ->
|
|
167
|
+
()
|
|
168
|
+
|
|
169
|
+
/// <summary>
|
|
170
|
+
/// Adds an FsCell of given rowIndex and columnIndex to an FsCellsCollection.
|
|
171
|
+
/// </summary>
|
|
172
|
+
static member addCellWithIndeces rowIndex colIndex (cell : FsCell) (cellsCollection : FsCellsCollection) =
|
|
173
|
+
cellsCollection.Add(rowIndex, colIndex, cell)
|
|
174
|
+
|
|
175
|
+
/// <summary>
|
|
176
|
+
/// Adds an FsCell to the FsCellsCollection.
|
|
177
|
+
/// </summary>
|
|
178
|
+
/// <remarks>Derives row- and columnIndex from the FsAddress of the FsCell.</remarks>
|
|
179
|
+
member this.Add(cell : FsCell) =
|
|
180
|
+
this.Add(cell.Address.RowNumber, cell.Address.ColumnNumber, cell)
|
|
181
|
+
|
|
182
|
+
/// <summary>
|
|
183
|
+
/// Adds an FsCell to an FsCellsCollection.
|
|
184
|
+
/// </summary>
|
|
185
|
+
/// <remarks>Derives row- and columnIndex from the FsAddress of the FsCell.</remarks>
|
|
186
|
+
static member addCell (cell : FsCell) (cellsCollection : FsCellsCollection) =
|
|
187
|
+
cellsCollection.Add(cell)
|
|
188
|
+
cellsCollection
|
|
189
|
+
|
|
190
|
+
/// <summary>
|
|
191
|
+
/// Adds FsCells to the FsCellsCollection.
|
|
192
|
+
/// </summary>
|
|
193
|
+
/// <remarks>Derives row- and columnIndeces from the FsAddress of the FsCells.</remarks>
|
|
194
|
+
member this.Add(cells : seq<FsCell>) =
|
|
195
|
+
cells |> Seq.iter (this.Add >> ignore)
|
|
196
|
+
|
|
197
|
+
/// <summary>
|
|
198
|
+
/// Adds FsCells to an FsCellsCollection.
|
|
199
|
+
/// </summary>
|
|
200
|
+
/// <remarks>Derives row- and columnIndeces from the FsAddress of the FsCells.</remarks>
|
|
201
|
+
static member addCells (cells : seq<FsCell>) (cellsCollection : FsCellsCollection) =
|
|
202
|
+
cellsCollection.Add cells
|
|
203
|
+
cellsCollection
|
|
204
|
+
|
|
205
|
+
/// <summary>
|
|
206
|
+
/// Checks if an FsCell exists at given row- and columnIndex.
|
|
207
|
+
/// </summary>
|
|
208
|
+
member this.ContainsCellAt(rowIndex, colIndex) =
|
|
209
|
+
match Dictionary.tryGet rowIndex _rowsCollection with
|
|
210
|
+
| Some colsCollection -> colsCollection.ContainsKey colIndex
|
|
211
|
+
| None -> false
|
|
212
|
+
|
|
213
|
+
/// <summary>
|
|
214
|
+
/// Checks if an FsCell exists at given row- and columnIndex of a given FsCellsCollection.
|
|
215
|
+
/// </summary>
|
|
216
|
+
static member containsCellAt rowIndex colIndex (cellsCollection : FsCellsCollection) =
|
|
217
|
+
cellsCollection.ContainsCellAt(rowIndex, colIndex)
|
|
218
|
+
|
|
219
|
+
//public void Remove(XLSheetPoint sheetPoint)
|
|
220
|
+
//{
|
|
221
|
+
// Remove(sheetPoint.Row, sheetPoint.Column);
|
|
222
|
+
//}
|
|
223
|
+
|
|
224
|
+
/// <summary>
|
|
225
|
+
/// Removes an FsCell of given rowIndex and columnIndex from the FsCellsCollection.
|
|
226
|
+
/// </summary>
|
|
227
|
+
member this.RemoveCellAt(row : int32, column : int32) =
|
|
228
|
+
|
|
229
|
+
_count <- _count - 1
|
|
230
|
+
let rowRemoved = FsCellsCollection.DecrementUsage(_rowsUsed, row);
|
|
231
|
+
let columnRemoved = FsCellsCollection.DecrementUsage(_columnsUsed, column);
|
|
232
|
+
|
|
233
|
+
if rowRemoved && row = _maxRowUsed then
|
|
234
|
+
|
|
235
|
+
_maxRowUsed <-
|
|
236
|
+
if (_rowsUsed.Keys :> IEnumerable<_>) |> Seq.isEmpty |> not then
|
|
237
|
+
_rowsUsed.Keys |> Seq.max
|
|
238
|
+
else 0
|
|
239
|
+
|
|
240
|
+
if columnRemoved && column = _maxColumnUsed then
|
|
241
|
+
|
|
242
|
+
_maxColumnUsed <-
|
|
243
|
+
if (_columnsUsed.Keys :> IEnumerable<_>) |> Seq.isEmpty |> not then
|
|
244
|
+
_columnsUsed.Keys |> Seq.max
|
|
245
|
+
else 0
|
|
246
|
+
|
|
247
|
+
match Dictionary.tryGet row _deleted with
|
|
248
|
+
| Some delHash when delHash.Contains(column) ->
|
|
249
|
+
()
|
|
250
|
+
| Some delHash ->
|
|
251
|
+
delHash.Add(column) |> ignore
|
|
252
|
+
| None ->
|
|
253
|
+
let delHash = new HashSet<int>()
|
|
254
|
+
delHash.Add(column) |> ignore
|
|
255
|
+
_deleted.Add(row, delHash)
|
|
256
|
+
|
|
257
|
+
match Dictionary.tryGet row _rowsCollection with
|
|
258
|
+
| Some columnsCollection ->
|
|
259
|
+
columnsCollection.Remove(column) |> ignore
|
|
260
|
+
if columnsCollection.Count = 0 then
|
|
261
|
+
_rowsCollection.Remove(row) |> ignore
|
|
262
|
+
| None ->
|
|
263
|
+
()
|
|
264
|
+
|
|
265
|
+
/// <summary>
|
|
266
|
+
/// Removes an FsCell of given rowIndex and columnIndex from an FsCellsCollection.
|
|
267
|
+
/// </summary>
|
|
268
|
+
static member removeCellAt rowIndex colIndex (cellsCollection : FsCellsCollection) =
|
|
269
|
+
cellsCollection.RemoveCellAt(rowIndex, colIndex)
|
|
270
|
+
cellsCollection
|
|
271
|
+
|
|
272
|
+
/// <summary>
|
|
273
|
+
/// Removes the value of an FsCell at given row- and columnIndex if it exists from the FsCollection.
|
|
274
|
+
/// </summary>
|
|
275
|
+
/// <remarks>Does nothing if the row or column of given index does not exist.</remarks>
|
|
276
|
+
/// <exception cref="System.ArgumentNullException">if columnIndex is null.</exception>
|
|
277
|
+
member this.TryRemoveValueAt(rowIndex, colIndex) =
|
|
278
|
+
match Dictionary.tryGet rowIndex _rowsCollection with
|
|
279
|
+
| Some colsCollection ->
|
|
280
|
+
try (colsCollection.Item colIndex).Value <- "" with
|
|
281
|
+
_ -> ()
|
|
282
|
+
| None -> ()
|
|
283
|
+
|
|
284
|
+
/// <summary>
|
|
285
|
+
/// Removes the value of an FsCell at given row- and columnIndex if it exists from a given FsCollection.
|
|
286
|
+
/// </summary>
|
|
287
|
+
/// <remarks>Does nothing if the row or column of given index does not exist.</remarks>
|
|
288
|
+
/// <exception>Throws `System.ArgumentNullException` if columnIndex is null.</exception>
|
|
289
|
+
static member tryRemoveValueAt rowIndex colIndex (cellsCollection : FsCellsCollection) =
|
|
290
|
+
cellsCollection.TryRemoveValueAt(rowIndex, colIndex)
|
|
291
|
+
cellsCollection
|
|
292
|
+
|
|
293
|
+
/// <summary>
|
|
294
|
+
/// Removes the value of an FsCell at given row- and columnIndex from the FsCollection.
|
|
295
|
+
/// </summary>
|
|
296
|
+
/// <exception cref="System.ArgumentNullException">if rowIndex or columnIndex is null.</exception>
|
|
297
|
+
/// <exception cref="System.Generic.KeyNotFoundException">if row or column at the given index does not exist.</exception>
|
|
298
|
+
member this.RemoveValueAt(rowIndex, colIndex) =
|
|
299
|
+
_rowsCollection
|
|
300
|
+
.Item(rowIndex)
|
|
301
|
+
.Item(colIndex)
|
|
302
|
+
.Value <- ""
|
|
303
|
+
|
|
304
|
+
/// <summary>
|
|
305
|
+
/// Removes the value of an FsCell at given row- and columnIndex from a given FsCollection.
|
|
306
|
+
/// </summary>
|
|
307
|
+
/// <exception cref="System.ArgumentNullException">if rowIndex or columnIndex is null.</exception>
|
|
308
|
+
/// <exception cref="System.Generic.KeyNotFoundException">if row or column at the given index does not exist.</exception>
|
|
309
|
+
static member removeValueAt rowIndex colIndex (cellsCollection : FsCellsCollection) =
|
|
310
|
+
cellsCollection.RemoveValueAt(rowIndex, colIndex)
|
|
311
|
+
cellsCollection
|
|
312
|
+
|
|
313
|
+
/// <summary>
|
|
314
|
+
/// Returns all FsCells of the FsCellsCollection.
|
|
315
|
+
/// </summary>
|
|
316
|
+
member this.GetCells() =
|
|
317
|
+
_rowsCollection.Values
|
|
318
|
+
|> Seq.collect (fun columnsCollection -> columnsCollection.Values)
|
|
319
|
+
|
|
320
|
+
/// <summary>
|
|
321
|
+
/// Returns all FsCells of the FsCellsCollection.
|
|
322
|
+
/// </summary>
|
|
323
|
+
static member getCells (cellsCollection : FsCellsCollection) =
|
|
324
|
+
cellsCollection.GetCells()
|
|
325
|
+
|
|
326
|
+
/// <summary>
|
|
327
|
+
/// Returns the FsCells from given rowStart to rowEnd and columnStart to columnEnd and fulfilling the predicate.
|
|
328
|
+
/// </summary>
|
|
329
|
+
member this.GetCells(rowStart : int32, columnStart : int32, rowEnd : int32, columnEnd : int32, predicate : FsCell -> bool) =
|
|
330
|
+
|
|
331
|
+
let finalRow = if rowEnd > _maxRowUsed then _maxRowUsed else rowEnd
|
|
332
|
+
let finalColumn = if columnEnd > _maxColumnUsed then _maxColumnUsed else columnEnd
|
|
333
|
+
seq {
|
|
334
|
+
for ro = rowStart to finalRow do
|
|
335
|
+
|
|
336
|
+
match Dictionary.tryGet ro _rowsCollection with
|
|
337
|
+
| Some columnsCollection ->
|
|
338
|
+
for co = columnStart to finalColumn do
|
|
339
|
+
match Dictionary.tryGet co columnsCollection with
|
|
340
|
+
| Some cell when predicate cell ->
|
|
341
|
+
yield cell
|
|
342
|
+
| _ -> ()
|
|
343
|
+
| None -> ()
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/// <summary>
|
|
347
|
+
/// Returns the FsCells from an FsCellsCollection with given rowStart to rowEnd and columnStart to columnEnd and fulfilling the predicate.
|
|
348
|
+
/// </summary>
|
|
349
|
+
static member filterCellsFromTo rowStart columnStart rowEnd columnEnd (predicate : FsCell -> bool) (cellsCollection : FsCellsCollection) =
|
|
350
|
+
cellsCollection.GetCells(rowStart, columnStart, rowEnd, columnEnd, predicate)
|
|
351
|
+
|
|
352
|
+
/// <summary>
|
|
353
|
+
/// Returns the FsCells from given startAddress to lastAddress and fulfilling the predicate.
|
|
354
|
+
/// </summary>
|
|
355
|
+
member this.GetCells(startAddress : FsAddress, lastAddress : FsAddress, predicate : FsCell -> bool) =
|
|
356
|
+
this.GetCells(startAddress.RowNumber,startAddress.ColumnNumber,lastAddress.RowNumber,lastAddress.ColumnNumber, predicate)
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
/// <summary>
|
|
360
|
+
/// Returns the FsCells from an FsCellsCollection with given startAddress to lastAddress and fulfilling the predicate.
|
|
361
|
+
/// </summary>
|
|
362
|
+
static member filterCellsFromToAddress startAddress lastAddress (predicate : FsCell -> bool) (cellsCollection : FsCellsCollection) =
|
|
363
|
+
cellsCollection.GetCells(startAddress, lastAddress, predicate)
|
|
364
|
+
|
|
365
|
+
/// <summary>
|
|
366
|
+
/// Returns the FsCells from given rowStart to rowEnd and columnStart to columnEnd.
|
|
367
|
+
/// </summary>
|
|
368
|
+
member this.GetCells(rowStart : int32, columnStart : int32, rowEnd : int32, columnEnd : int32) =
|
|
369
|
+
let finalRow = if rowEnd > _maxRowUsed then _maxRowUsed else rowEnd
|
|
370
|
+
let finalColumn = if columnEnd > _maxColumnUsed then _maxColumnUsed else columnEnd
|
|
371
|
+
seq {
|
|
372
|
+
for ro = rowStart to finalRow do
|
|
373
|
+
|
|
374
|
+
match Dictionary.tryGet ro _rowsCollection with
|
|
375
|
+
| Some columnsCollection ->
|
|
376
|
+
for co = columnStart to finalColumn do
|
|
377
|
+
match Dictionary.tryGet co columnsCollection with
|
|
378
|
+
| Some cell ->
|
|
379
|
+
yield cell
|
|
380
|
+
| _ -> ()
|
|
381
|
+
| None -> ()
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/// <summary>
|
|
385
|
+
/// Returns the FsCells from an FsCellsCollection with given rowStart to rowEnd and columnStart to columnEnd.
|
|
386
|
+
/// </summary>
|
|
387
|
+
static member getCellsFromTo rowStart columnStart rowEnd columnEnd (cellsCollection : FsCellsCollection) =
|
|
388
|
+
cellsCollection.GetCells(rowStart, columnStart, rowEnd, columnEnd)
|
|
389
|
+
|
|
390
|
+
/// <summary>
|
|
391
|
+
/// Returns the FsCells from given startAddress to lastAddress.
|
|
392
|
+
/// </summary>
|
|
393
|
+
member this.GetCells(startAddress : FsAddress, lastAddress : FsAddress) =
|
|
394
|
+
this.GetCells(startAddress.RowNumber,startAddress.ColumnNumber,lastAddress.RowNumber,lastAddress.ColumnNumber)
|
|
395
|
+
|
|
396
|
+
/// <summary>
|
|
397
|
+
/// Returns the FsCells from an FsCellsCollection with given startAddress to lastAddress.
|
|
398
|
+
/// </summary>
|
|
399
|
+
static member getCellsFromToAddress startAddress lastAddress (cellsCollection : FsCellsCollection) =
|
|
400
|
+
cellsCollection.GetCells(startAddress, lastAddress)
|
|
401
|
+
|
|
402
|
+
//public int FirstRowUsed(int rowStart, int columnStart, int rowEnd, int columnEnd, XLCellsUsedOptions options,
|
|
403
|
+
// Func<IXLCell, Boolean> predicate = null)
|
|
404
|
+
//{
|
|
405
|
+
// int finalRow = rowEnd > MaxRowUsed ? MaxRowUsed : rowEnd;
|
|
406
|
+
// int finalColumn = columnEnd > MaxColumnUsed ? MaxColumnUsed : columnEnd;
|
|
407
|
+
// for (int ro = rowStart; ro <= finalRow; ro++)
|
|
408
|
+
// {
|
|
409
|
+
// if (RowsCollection.TryGetValue(ro, out Dictionary<int32, XLCell> columnsCollection))
|
|
410
|
+
// {
|
|
411
|
+
// for (int co = columnStart; co <= finalColumn; co++)
|
|
412
|
+
// {
|
|
413
|
+
// if (columnsCollection.TryGetValue(co, out XLCell cell)
|
|
414
|
+
// && !cell.IsEmpty(options)
|
|
415
|
+
// && (predicate == null || predicate(cell)))
|
|
416
|
+
|
|
417
|
+
// return ro;
|
|
418
|
+
// }
|
|
419
|
+
// }
|
|
420
|
+
// }
|
|
421
|
+
|
|
422
|
+
// return 0;
|
|
423
|
+
//}
|
|
424
|
+
|
|
425
|
+
//public int FirstColumnUsed(int rowStart, int columnStart, int rowEnd, int columnEnd, XLCellsUsedOptions options,
|
|
426
|
+
// Func<IXLCell, Boolean> predicate = null)
|
|
427
|
+
//{
|
|
428
|
+
// int finalRow = rowEnd > MaxRowUsed ? MaxRowUsed : rowEnd;
|
|
429
|
+
// int finalColumn = columnEnd > MaxColumnUsed ? MaxColumnUsed : columnEnd;
|
|
430
|
+
// int firstColumnUsed = finalColumn;
|
|
431
|
+
// var found = false;
|
|
432
|
+
// for (int ro = rowStart; ro <= finalRow; ro++)
|
|
433
|
+
// {
|
|
434
|
+
// if (RowsCollection.TryGetValue(ro, out Dictionary<int32, XLCell> columnsCollection))
|
|
435
|
+
// {
|
|
436
|
+
// for (int co = columnStart; co <= firstColumnUsed; co++)
|
|
437
|
+
// {
|
|
438
|
+
// if (columnsCollection.TryGetValue(co, out XLCell cell)
|
|
439
|
+
// && !cell.IsEmpty(options)
|
|
440
|
+
// && (predicate == null || predicate(cell))
|
|
441
|
+
// && co <= firstColumnUsed)
|
|
442
|
+
// {
|
|
443
|
+
// firstColumnUsed = co;
|
|
444
|
+
// found = true;
|
|
445
|
+
// break;
|
|
446
|
+
// }
|
|
447
|
+
// }
|
|
448
|
+
// }
|
|
449
|
+
// }
|
|
450
|
+
|
|
451
|
+
// return found ? firstColumnUsed : 0;
|
|
452
|
+
//}
|
|
453
|
+
|
|
454
|
+
//public int LastRowUsed(int rowStart, int columnStart, int rowEnd, int columnEnd, XLCellsUsedOptions options,
|
|
455
|
+
// Func<IXLCell, Boolean> predicate = null)
|
|
456
|
+
//{
|
|
457
|
+
// int finalRow = rowEnd > MaxRowUsed ? MaxRowUsed : rowEnd;
|
|
458
|
+
// int finalColumn = columnEnd > MaxColumnUsed ? MaxColumnUsed : columnEnd;
|
|
459
|
+
// for (int ro = finalRow; ro >= rowStart; ro--)
|
|
460
|
+
// {
|
|
461
|
+
// if (RowsCollection.TryGetValue(ro, out Dictionary<int32, XLCell> columnsCollection))
|
|
462
|
+
// {
|
|
463
|
+
// for (int co = finalColumn; co >= columnStart; co--)
|
|
464
|
+
// {
|
|
465
|
+
// if (columnsCollection.TryGetValue(co, out XLCell cell)
|
|
466
|
+
// && !cell.IsEmpty(options)
|
|
467
|
+
// && (predicate == null || predicate(cell)))
|
|
468
|
+
|
|
469
|
+
// return ro;
|
|
470
|
+
// }
|
|
471
|
+
// }
|
|
472
|
+
// }
|
|
473
|
+
// return 0;
|
|
474
|
+
//}
|
|
475
|
+
|
|
476
|
+
//public int LastColumnUsed(int rowStart, int columnStart, int rowEnd, int columnEnd, XLCellsUsedOptions options,
|
|
477
|
+
// Func<IXLCell, Boolean> predicate = null)
|
|
478
|
+
//{
|
|
479
|
+
// int maxCo = 0;
|
|
480
|
+
// int finalRow = rowEnd > MaxRowUsed ? MaxRowUsed : rowEnd;
|
|
481
|
+
// int finalColumn = columnEnd > MaxColumnUsed ? MaxColumnUsed : columnEnd;
|
|
482
|
+
// for (int ro = finalRow; ro >= rowStart; ro--)
|
|
483
|
+
// {
|
|
484
|
+
// if (RowsCollection.TryGetValue(ro, out Dictionary<int, XLCell> columnsCollection))
|
|
485
|
+
// {
|
|
486
|
+
// for (int co = finalColumn; co >= columnStart && co > maxCo; co--)
|
|
487
|
+
// {
|
|
488
|
+
// if (columnsCollection.TryGetValue(co, out XLCell cell)
|
|
489
|
+
// && !cell.IsEmpty(options)
|
|
490
|
+
// && (predicate == null || predicate(cell)))
|
|
491
|
+
|
|
492
|
+
// maxCo = co;
|
|
493
|
+
// }
|
|
494
|
+
// }
|
|
495
|
+
// }
|
|
496
|
+
// return maxCo;
|
|
497
|
+
//}
|
|
498
|
+
|
|
499
|
+
//public void RemoveAll(int32 rowStart, int32 columnStart,
|
|
500
|
+
// int32 rowEnd, int32 columnEnd)
|
|
501
|
+
//{
|
|
502
|
+
// int finalRow = rowEnd > MaxRowUsed ? MaxRowUsed : rowEnd;
|
|
503
|
+
// int finalColumn = columnEnd > MaxColumnUsed ? MaxColumnUsed : columnEnd;
|
|
504
|
+
// for (int ro = rowStart; ro <= finalRow; ro++)
|
|
505
|
+
// {
|
|
506
|
+
// if (RowsCollection.TryGetValue(ro, out Dictionary<int, XLCell> columnsCollection))
|
|
507
|
+
// {
|
|
508
|
+
// for (int co = columnStart; co <= finalColumn; co++)
|
|
509
|
+
// {
|
|
510
|
+
// if (columnsCollection.ContainsKey(co))
|
|
511
|
+
// Remove(ro, co);
|
|
512
|
+
// }
|
|
513
|
+
// }
|
|
514
|
+
// }
|
|
515
|
+
//}
|
|
516
|
+
|
|
517
|
+
//public IEnumerable<XLSheetPoint> GetSheetPoints(int32 rowStart, int32 columnStart,
|
|
518
|
+
// int32 rowEnd, int32 columnEnd)
|
|
519
|
+
//{
|
|
520
|
+
// int finalRow = rowEnd > MaxRowUsed ? MaxRowUsed : rowEnd;
|
|
521
|
+
// int finalColumn = columnEnd > MaxColumnUsed ? MaxColumnUsed : columnEnd;
|
|
522
|
+
// for (int ro = rowStart; ro <= finalRow; ro++)
|
|
523
|
+
// {
|
|
524
|
+
// if (RowsCollection.TryGetValue(ro, out Dictionary<int32, XLCell> columnsCollection))
|
|
525
|
+
// {
|
|
526
|
+
// for (int co = columnStart; co <= finalColumn; co++)
|
|
527
|
+
// {
|
|
528
|
+
// if (columnsCollection.ContainsKey(co))
|
|
529
|
+
// yield return new XLSheetPoint(ro, co);
|
|
530
|
+
// }
|
|
531
|
+
// }
|
|
532
|
+
// }
|
|
533
|
+
//}
|
|
534
|
+
|
|
535
|
+
/// <summary>
|
|
536
|
+
/// Returns the FsCell at given rowIndex and columnIndex if it exists. Otherwise returns None.
|
|
537
|
+
/// </summary>
|
|
538
|
+
member this.TryGetCell(row : int32, column : int32) =
|
|
539
|
+
|
|
540
|
+
if (row > _maxRowUsed || column > _maxColumnUsed) then
|
|
541
|
+
None
|
|
542
|
+
|
|
543
|
+
else
|
|
544
|
+
match Dictionary.tryGet row _rowsCollection with
|
|
545
|
+
| Some columnsCollection ->
|
|
546
|
+
match Dictionary.tryGet column columnsCollection with
|
|
547
|
+
| Some cell -> Some cell
|
|
548
|
+
| None -> None
|
|
549
|
+
| None -> None
|
|
550
|
+
|
|
551
|
+
/// <summary>
|
|
552
|
+
/// Returns the FsCell from an FsCellsCollection at given rowIndex and columnIndex if it exists. Otherwise returns None.
|
|
553
|
+
/// </summary>
|
|
554
|
+
static member tryGetCell rowIndex colIndex (cellsCollection : FsCellsCollection) =
|
|
555
|
+
cellsCollection.TryGetCell(rowIndex, colIndex)
|
|
556
|
+
|
|
557
|
+
//public XLCell GetCell(XLSheetPoint sp)
|
|
558
|
+
//{
|
|
559
|
+
// return GetCell(sp.Row, sp.Column);
|
|
560
|
+
//}
|
|
561
|
+
|
|
562
|
+
//internal void SwapRanges(XLSheetRange sheetRange1, XLSheetRange sheetRange2, XLWorksheet worksheet)
|
|
563
|
+
//{
|
|
564
|
+
// int32 rowCount = sheetRange1.LastPoint.Row - sheetRange1.FirstPoint.Row + 1;
|
|
565
|
+
// int32 columnCount = sheetRange1.LastPoint.Column - sheetRange1.FirstPoint.Column + 1;
|
|
566
|
+
// for (int row = 0; row < rowCount; row++)
|
|
567
|
+
// {
|
|
568
|
+
// for (int column = 0; column < columnCount; column++)
|
|
569
|
+
// {
|
|
570
|
+
// var sp1 = new XLSheetPoint(sheetRange1.FirstPoint.Row + row, sheetRange1.FirstPoint.Column + column);
|
|
571
|
+
// var sp2 = new XLSheetPoint(sheetRange2.FirstPoint.Row + row, sheetRange2.FirstPoint.Column + column);
|
|
572
|
+
// var cell1 = GetCell(sp1);
|
|
573
|
+
// var cell2 = GetCell(sp2);
|
|
574
|
+
|
|
575
|
+
// if (cell1 == null) cell1 = worksheet.Cell(sp1.Row, sp1.Column);
|
|
576
|
+
// if (cell2 == null) cell2 = worksheet.Cell(sp2.Row, sp2.Column);
|
|
577
|
+
|
|
578
|
+
// //if (cell1 != null)
|
|
579
|
+
// //{
|
|
580
|
+
// cell1.Address = new XLAddress(cell1.Worksheet, sp2.Row, sp2.Column, false, false);
|
|
581
|
+
// Remove(sp1);
|
|
582
|
+
// //if (cell2 != null)
|
|
583
|
+
// Add(sp1, cell2);
|
|
584
|
+
// //}
|
|
585
|
+
|
|
586
|
+
// //if (cell2 == null) continue;
|
|
587
|
+
|
|
588
|
+
// cell2.Address = new XLAddress(cell2.Worksheet, sp1.Row, sp1.Column, false, false);
|
|
589
|
+
// Remove(sp2);
|
|
590
|
+
// //if (cell1 != null)
|
|
591
|
+
// Add(sp2, cell1);
|
|
592
|
+
// }
|
|
593
|
+
// }
|
|
594
|
+
//}
|
|
595
|
+
|
|
596
|
+
//internal IEnumerable<XLCell> GetCells()
|
|
597
|
+
//{
|
|
598
|
+
// return GetCells(1, 1, MaxRowUsed, MaxColumnUsed);
|
|
599
|
+
//}
|
|
600
|
+
|
|
601
|
+
//internal IEnumerable<XLCell> GetCells(Func<IXLCell, Boolean> predicate)
|
|
602
|
+
//{
|
|
603
|
+
// for (int ro = 1; ro <= MaxRowUsed; ro++)
|
|
604
|
+
// {
|
|
605
|
+
// if (RowsCollection.TryGetValue(ro, out Dictionary<int32, XLCell> columnsCollection))
|
|
606
|
+
// {
|
|
607
|
+
// for (int co = 1; co <= MaxColumnUsed; co++)
|
|
608
|
+
// {
|
|
609
|
+
// if (columnsCollection.TryGetValue(co, out XLCell cell)
|
|
610
|
+
// && (predicate == null || predicate(cell)))
|
|
611
|
+
// yield return cell;
|
|
612
|
+
// }
|
|
613
|
+
// }
|
|
614
|
+
// }
|
|
615
|
+
//}
|
|
616
|
+
|
|
617
|
+
//public Boolean Contains(int32 row, int32 column)
|
|
618
|
+
//{
|
|
619
|
+
// return RowsCollection.TryGetValue(row, out Dictionary<int32, XLCell> columnsCollection)
|
|
620
|
+
// && columnsCollection.ContainsKey(column);
|
|
621
|
+
//}
|
|
622
|
+
|
|
623
|
+
//public int32 MinRowInColumn(int32 column)
|
|
624
|
+
//{
|
|
625
|
+
// for (int row = 1; row <= MaxRowUsed; row++)
|
|
626
|
+
// {
|
|
627
|
+
// if (RowsCollection.TryGetValue(row, out Dictionary<int32, XLCell> columnsCollection)
|
|
628
|
+
// && columnsCollection.ContainsKey(column))
|
|
629
|
+
|
|
630
|
+
// return row;
|
|
631
|
+
// }
|
|
632
|
+
|
|
633
|
+
// return 0;
|
|
634
|
+
//}
|
|
635
|
+
|
|
636
|
+
//public int32 MaxRowInColumn(int32 column)
|
|
637
|
+
//{
|
|
638
|
+
// for (int row = MaxRowUsed; row >= 1; row--)
|
|
639
|
+
// {
|
|
640
|
+
// if (RowsCollection.TryGetValue(row, out Dictionary<int32, XLCell> columnsCollection)
|
|
641
|
+
// && columnsCollection.ContainsKey(column))
|
|
642
|
+
|
|
643
|
+
// return row;
|
|
644
|
+
// }
|
|
645
|
+
|
|
646
|
+
// return 0;
|
|
647
|
+
//}
|
|
648
|
+
|
|
649
|
+
//public int32 MinColumnInRow(int32 row)
|
|
650
|
+
//{
|
|
651
|
+
// if (RowsCollection.TryGetValue(row, out Dictionary<int32, XLCell> columnsCollection)
|
|
652
|
+
// && columnsCollection.Any())
|
|
653
|
+
|
|
654
|
+
// return columnsCollection.Keys.Min();
|
|
655
|
+
|
|
656
|
+
// return 0;
|
|
657
|
+
//}
|
|
658
|
+
|
|
659
|
+
//public int32 MaxColumnInRow(int32 row)
|
|
660
|
+
//{
|
|
661
|
+
// if (RowsCollection.TryGetValue(row, out Dictionary<int32, XLCell> columnsCollection)
|
|
662
|
+
// && columnsCollection.Any())
|
|
663
|
+
|
|
664
|
+
// return columnsCollection.Keys.Max();
|
|
665
|
+
|
|
666
|
+
// return 0;
|
|
667
|
+
//}
|
|
668
|
+
|
|
669
|
+
/// <summary>
|
|
670
|
+
/// Returns all FsCells in the given columnIndex.
|
|
671
|
+
/// </summary>
|
|
672
|
+
member this.GetCellsInColumn(colIndex) =
|
|
673
|
+
this.GetCells(1, colIndex, _maxRowUsed, colIndex)
|
|
674
|
+
|
|
675
|
+
/// <summary>
|
|
676
|
+
/// Returns all FsCells in an FsCellsCollection with the given columnIndex.
|
|
677
|
+
/// </summary>
|
|
678
|
+
static member getCellsInColumn colIndex (cellsCollection : FsCellsCollection) =
|
|
679
|
+
cellsCollection.GetCellsInColumn colIndex
|
|
680
|
+
|
|
681
|
+
/// <summary>
|
|
682
|
+
/// Returns all FsCells in the given rowIndex.
|
|
683
|
+
/// </summary>
|
|
684
|
+
member this.GetCellsInRow(rowIndex) =
|
|
685
|
+
this.GetCells(rowIndex, 1, rowIndex, _maxColumnUsed)
|
|
686
|
+
|
|
687
|
+
/// <summary>
|
|
688
|
+
/// Returns all FsCells in an FsCellsCollection with the given rowIndex.
|
|
689
|
+
/// </summary>
|
|
690
|
+
static member getCellsInRow rowIndex (cellsCollection : FsCellsCollection) =
|
|
691
|
+
cellsCollection.GetCellsInRow rowIndex
|
|
692
|
+
|
|
693
|
+
/// <summary>
|
|
694
|
+
/// Returns the upper left corner of the FsCellsCollection.
|
|
695
|
+
/// </summary>
|
|
696
|
+
member this.GetFirstAddress() =
|
|
697
|
+
if Seq.isEmpty _rowsCollection || Seq.isEmpty _rowsCollection.Keys then
|
|
698
|
+
FsAddress(0,0)
|
|
699
|
+
else
|
|
700
|
+
let minRow = _rowsCollection.Keys |> Seq.min
|
|
701
|
+
let minCol =
|
|
702
|
+
_rowsCollection.Values
|
|
703
|
+
|> Seq.minBy (fun d -> Seq.min d.Keys)
|
|
704
|
+
|> fun d -> Seq.min d.Keys
|
|
705
|
+
FsAddress(minRow, minCol)
|
|
706
|
+
|
|
707
|
+
/// <summary>
|
|
708
|
+
/// Returns the upper left corner of a given FsCellsCollection.
|
|
709
|
+
/// </summary>
|
|
710
|
+
static member getFirstAddress (cells : FsCellsCollection) =
|
|
711
|
+
cells.GetFirstAddress()
|
|
712
|
+
|
|
713
|
+
/// <summary>
|
|
714
|
+
/// Returns the lower right corner of the FsCellsCollection.
|
|
715
|
+
/// </summary>
|
|
716
|
+
member this.GetLastAddress() =
|
|
717
|
+
FsAddress(this.MaxRowNumber, this.MaxColumnNumber)
|
|
718
|
+
|
|
719
|
+
/// <summary>
|
|
720
|
+
/// Returns the lower right corner of a given FsCellsCollection.
|
|
721
|
+
/// </summary>
|
|
722
|
+
static member getLastAddress (cells : FsCellsCollection) =
|
|
723
|
+
cells.GetLastAddress()
|
|
724
|
+
|
|
725
|
+
// TO DO: Add method to get FsRange when possible
|