Fix issue with ModelBackedItem and headers

This commit is contained in:
Matt Nadareski
2024-07-03 10:30:12 -04:00
parent fbc13c0018
commit 31f9711947

View File

@@ -1,4 +1,5 @@
using System.Xml.Serialization;
using System;
using System.Xml.Serialization;
using Newtonsoft.Json;
using SabreTools.Core.Tools;
@@ -13,13 +14,13 @@ namespace SabreTools.Core
/// Internal model wrapped by this DatItem
/// </summary>
[JsonIgnore, XmlIgnore]
protected Models.Metadata.DictionaryBase _internal;
protected T _internal;
#region Constructors
public ModelBackedItem()
{
_internal = new DummyItem();
_internal = (T)Activator.CreateInstance(typeof(T))!;
}
#endregion
@@ -148,14 +149,5 @@ namespace SabreTools.Core
}
#endregion
#region Dummy Classes
/// <summary>
/// Dummy item for use with the default constructor
/// </summary>
private class DummyItem : Models.Metadata.DictionaryBase { }
#endregion
}
}