mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add explicit list of supported types
This commit is contained in:
@@ -111,6 +111,12 @@ namespace SabreTools.Library.DatFiles
|
||||
svr.Dispose();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -407,6 +407,21 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[]
|
||||
{
|
||||
ItemType.Archive,
|
||||
ItemType.BiosSet,
|
||||
ItemType.Disk,
|
||||
ItemType.Media,
|
||||
ItemType.Release,
|
||||
ItemType.Rom,
|
||||
ItemType.Sample,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -2339,7 +2339,6 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO: See if any of the helper methods can be broken up a bit more neatly
|
||||
#region Rebuilding and Verifying
|
||||
|
||||
/// <summary>
|
||||
@@ -3777,6 +3776,15 @@ namespace SabreTools.Library.DatFiles
|
||||
return rom;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get supported types for write
|
||||
/// </summary>
|
||||
/// <returns>List of supported types for writing</returns>
|
||||
protected virtual ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return Enum.GetValues(typeof(ItemType)) as ItemType[];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get if an item should be ignored on write
|
||||
/// </summary>
|
||||
@@ -3803,6 +3811,10 @@ namespace SabreTools.Library.DatFiles
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we have an item type not in the list of supported values
|
||||
if (!GetSupportedTypes().Contains(datItem.ItemType))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -247,6 +247,12 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -83,6 +83,12 @@ namespace SabreTools.Library.DatFiles
|
||||
sr.Dispose();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -98,6 +98,12 @@ namespace SabreTools.Library.DatFiles
|
||||
sr.Dispose();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Disk, ItemType.Media, ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -250,6 +250,12 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Disk, ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -1126,6 +1126,34 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[]
|
||||
{
|
||||
ItemType.Adjuster,
|
||||
ItemType.BiosSet,
|
||||
ItemType.Chip,
|
||||
ItemType.Condition,
|
||||
ItemType.Configuration,
|
||||
ItemType.Device,
|
||||
ItemType.DeviceReference,
|
||||
ItemType.DipSwitch,
|
||||
ItemType.Disk,
|
||||
ItemType.Display,
|
||||
ItemType.Driver,
|
||||
ItemType.Feature,
|
||||
ItemType.Input,
|
||||
ItemType.Port,
|
||||
ItemType.RamOption,
|
||||
ItemType.Rom,
|
||||
ItemType.Sample,
|
||||
ItemType.Slot,
|
||||
ItemType.SoftwareList,
|
||||
ItemType.Sound,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -658,6 +658,21 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[]
|
||||
{
|
||||
ItemType.Archive,
|
||||
ItemType.BiosSet,
|
||||
ItemType.Disk,
|
||||
ItemType.Media,
|
||||
ItemType.Release,
|
||||
ItemType.Rom,
|
||||
ItemType.Sample,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -654,6 +654,12 @@ namespace SabreTools.Library.DatFiles
|
||||
return roms;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -508,6 +508,12 @@ namespace SabreTools.Library.DatFiles
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -361,6 +361,12 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -99,6 +99,12 @@ namespace SabreTools.Library.DatFiles
|
||||
svr.Dispose();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[] { ItemType.Disk, ItemType.Media, ItemType.Rom };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
@@ -500,6 +500,19 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override ItemType[] GetSupportedTypes()
|
||||
{
|
||||
return new ItemType[]
|
||||
{
|
||||
ItemType.DipSwitch,
|
||||
ItemType.Disk,
|
||||
ItemType.Info,
|
||||
ItemType.Rom,
|
||||
ItemType.SharedFeature,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a dictionary
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user