Use DictionaryBase for setters

This commit is contained in:
Matt Nadareski
2024-03-05 02:20:12 -05:00
parent 539e4367e0
commit 2b2aa5aff8
47 changed files with 845 additions and 796 deletions

View File

@@ -131,6 +131,22 @@ namespace SabreTools.DatItems.Formats
return FieldManipulator.RemoveField(_internal, fieldName);
}
/// <inheritdoc/>
public override bool SetField(DatItemField datItemField, string value)
{
// Get the correct internal field name
string? fieldName = datItemField switch
{
DatItemField.Filter => Models.Metadata.SoftwareList.FilterKey,
DatItemField.SoftwareListStatus => Models.Metadata.SoftwareList.StatusKey,
DatItemField.Tag => Models.Metadata.SoftwareList.TagKey,
_ => null,
};
// Set the field and return
return FieldManipulator.SetField(_internal, fieldName, value);
}
#endregion
}
}