mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Use DictionaryBase for removal
This commit is contained in:
@@ -5,6 +5,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -136,5 +137,27 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
DatItemField.DeviceType => Models.Metadata.Device.DeviceTypeKey,
|
||||
DatItemField.FixedImage => Models.Metadata.Device.FixedImageKey,
|
||||
DatItemField.Interface => Models.Metadata.Device.InterfaceKey,
|
||||
DatItemField.Mandatory => Models.Metadata.Device.MandatoryKey,
|
||||
DatItemField.Tag => Models.Metadata.Device.TagKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user