GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
ConverterSettings.cs
1// =============================================================================
2// GPAL - Generally Positive Automation Library
3// Copyright © 2026 Software Decisions, Inc. All rights reserved.
4//
5// This file is part of GPAL.
6// Licensed under the Business Source License 1.1
7//
8// Primary development, architecture, and vision by Michael B. Vederman,
9// CEO of Software Decisions, Inc., Texas.
10//
11// Internal development maintained privately.
12// Public releases appear on GitHub: https://github.com/SoftwareDecisionsInc/GPAL.
13//
14// See LICENSE for full terms, including Additional Use Grant.
15// =============================================================================
16
17using System;
18using System.Collections.Generic;
19using System.Linq;
20using System.Text;
21using System.Threading.Tasks;
22using System.Xml;
23using static GenerallyPositive.Enums;
24
25namespace GenerallyPositive
26{
27 public class ConverterSettings
28 {
29 public ConverterSettings()
30 {
31 InputDictionary = new List<Dictionary<object, dynamic>>();
32 InDataFormat = new List<DataFormat>();
33 InputGrid = new List<IGPALGrid<string>>();
34 InputData = new List<string>();
35 ColumnNames = new GPALGrid<string>();
36 ExcelSheetNames = new GPALGrid<string>();
37 ExcelRowsPerSheet = new GPALGrid<int>();
38 RegisteredStructs = new HashSet<Type>();
39 RegisteredStructs.Add(typeof(WaitTime));
40 }
41
42 internal HashSet<Type> RegisteredStructs { get; set; }
43
44 internal XmlDocument InputXmlDocument { get; set; }
45 internal XmlDocument OutputXmlDocument { get; set; }
46 internal IGPALDatabase InputDatabase { get; set; }
47 internal IGPALDatabase OutputDatabase { get; set; }
48 internal List<IGPALGrid<string>> InputGrid { get; set; }
49 internal IGPALGrid<string> OutputGrid { get; set; }
50 internal IGPALGrid<string> ColumnNames { get; set; }
51 internal IGPALGrid<string> ExcelSheetNames { get; set; } // a list for each filename supplied, or one for all. If not supplied, generate column1, column2...
52 internal IGPALGrid<int> ExcelRowsPerSheet { get; set; } // a list for each filename supplied, or one for all. If not supplied, generate column1, column2...
53 internal List<Dictionary<object, dynamic>> InputDictionary { get; set; }
54 internal Dictionary<string, string> OutputDictionary { get; set; }
55 internal List<string> InputData { get; set; }
56 internal string OutputData { get; set; }
57 internal GPALFile InputFile { get; set; }
58 internal GPALFile OutputFile { get; set; }
59 internal dynamic InputClass { get; set; }
60 internal Type InputClassType { get; set; }
61 internal Type InputClassElementType { get; set; }
62 internal dynamic OutputClass { get; set; }
63 internal Type OutputClassType { get; set; }
64 internal Type OutputClassElementType { get; set; }
65 internal List<DataFormat> InDataFormat { get; set; }
66 internal DataFormat OutDataFormat { get; set; } = DataFormat.NOTSET;
67 internal bool IgnoreFirstLineColumnHeaders { get; set; } // overrides each individual file settings or used with non-file types
68 internal bool FirstLineIsColumnHeaders { get; set; } // overrides each individual file settings or used with non-file types; reset per-output-file during Convert()
69 internal bool InputFirstLineIsColumnHeaders { get; set; } // set via WithFirstLineHasColumnNames(); preserved across all SaveTo/AppendTo calls in a chain
70 internal bool FieldsEnclosedInQuotes { get; set; } // overrides each individual file settings or used with non-file types
71 internal char? InDelimiter { get; set; } // overrides each individual file settings or used with non-file types
72 internal char? OutDelimiter { get; set; } // overrides each individual file settings or used with non-file types
73
74 public void ClearDerived()
75 {
76 InputData = new List<string>();
77 InputDictionary = new List<Dictionary<object, dynamic>>();
78 InputGrid = new List<IGPALGrid<string>>();
79
80 OutputClass = null;
81 OutputClassElementType = null;
82 OutputClassType = null;
83 OutputData = string.Empty;
84 OutputDictionary = new Dictionary<string, string>();
85 OutputGrid = GPAL.Grid.ToGPALObject();
86 }
87 }
88}
89
GPAL File object instantied with GPAL.File Used to load tokens into a GPALGrid [rows/columns].
Definition GPALFile.cs:36
Everything starts here, all the GPAL controls and global settings using fluent syntax are here....
Definition GPAL.cs:49
static IAllowGridActions< string > Grid
New GPALGrid<string></string> (rows/columns).
Definition GPAL.cs:521