This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
using System;
using System.Windows;
namespace DatabaseImport
{
public class TestObjectTemplateCollection //: BasePropertyChanged
{
private static volatile TestObjectTemplateCollection _testObjectCollection;
public static TestObjectTemplateCollection TemplateCollection
{
get
{
if (null == _testObjectCollection)
{
_testObjectCollection = new TestObjectTemplateCollection();
}
return _testObjectCollection;
}
}
public void ReloadAll(bool loadSubComponents)
{
//UnloadAll();
//if (loadSubComponents)
//{
// (App.Current as App).IsoDb.RefreshAllData();
// DataModel.CustomChannelList.List.ReloadAll();
//}
//Reload();
}
private static volatile TestObjectTemplate _sysBuiltTestObjectTemplate;
public TestObjectTemplate SysBuiltTestObjectTemplate => _sysBuiltTestObjectTemplate;
public TestObjectTemplate GetTemplate(string templateId)
{
var db = ((App)Application.Current).IsoDb;
var isoTemplate = ISO.TestObjectTemplate.GetTemplate(ref db, templateId);
return null != isoTemplate ? new TestObjectTemplate(isoTemplate, ref db) : null;
}
/// <summary>
/// deletes all test objects
/// originally created so TDM imports could clear all tables
/// </summary>
public static void DeleteAll()
{
//if (TemplateCollection._bUnloaded) { Reload(); }
_testObjectCollection.DeleteAllTemplates();
_testObjectCollection = new TestObjectTemplateCollection();
TemplateCollection.DeleteAllTemplates();
//TemplateCollection._templates.Clear();
}
private void DeleteAllTemplates()
{
try
{
//if (_bUnloaded) { Reload(); }
ISO.TestObjectTemplate.DeleteAllTemplates();
}
catch (Exception) { /*APILogger.Log("failed to delete all templates"); */}
}
}
}