From 5265ceb0dacd6bf0bafd59842da5c6ed66f51d52 Mon Sep 17 00:00:00 2001 From: Chris Bell Date: Wed, 28 Jan 2026 22:02:58 -0600 Subject: [PATCH] More work on SzDataHandler --- SzCli/Program.cs | 3 ++- SzCore/SzDataHandler.cs | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/SzCli/Program.cs b/SzCli/Program.cs index c4ebb9a..e5d796a 100644 --- a/SzCli/Program.cs +++ b/SzCli/Program.cs @@ -9,10 +9,11 @@ public class Program { private static readonly DefaultLocalFileManager _fileManager = new(); private static readonly Logger _logger = new(_fileManager); + private static readonly DefaultDatabaseHandler _dbHandler = new(); public static void Main(string[] args) { - SZ.Init(_fileManager, _logger); + SZ.Init(_fileManager, _logger, _dbHandler); bool shouldClose = false; diff --git a/SzCore/SzDataHandler.cs b/SzCore/SzDataHandler.cs index 8fc3533..e61a2fe 100644 --- a/SzCore/SzDataHandler.cs +++ b/SzCore/SzDataHandler.cs @@ -175,7 +175,22 @@ public class SzDataHandler #region Other - public Sz + public SzTemplateField? CreateTemplateField(string id, SzFieldType fieldType, bool isList = false, string? defaultValue = null, bool isSpecialType = false, string? specialTypeValue = null) + { + if (string.IsNullOrEmpty(id)) return null; + + var newField = new SzTemplateField() + { + Id = id, + FieldType = fieldType, + IsList = isList, + IsSpecialType = isSpecialType, + DefaultValue = defaultValue ?? "", + SpecialTypeValue = specialTypeValue ?? "" + }; + + return newField; + } #endregion