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();
|
svr.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -2339,7 +2339,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// TODO: See if any of the helper methods can be broken up a bit more neatly
|
|
||||||
#region Rebuilding and Verifying
|
#region Rebuilding and Verifying
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -3777,6 +3776,15 @@ namespace SabreTools.Library.DatFiles
|
|||||||
return rom;
|
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>
|
/// <summary>
|
||||||
/// Get if an item should be ignored on write
|
/// Get if an item should be ignored on write
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -3803,6 +3811,10 @@ namespace SabreTools.Library.DatFiles
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we have an item type not in the list of supported values
|
||||||
|
if (!GetSupportedTypes().Contains(datItem.ItemType))
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -247,6 +247,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
sr.Dispose();
|
sr.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -98,6 +98,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
sr.Dispose();
|
sr.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Disk, ItemType.Media, ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -250,6 +250,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Disk, ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -654,6 +654,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
return roms;
|
return roms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -508,6 +508,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -361,6 +361,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -99,6 +99,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
svr.Dispose();
|
svr.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override ItemType[] GetSupportedTypes()
|
||||||
|
{
|
||||||
|
return new ItemType[] { ItemType.Disk, ItemType.Media, ItemType.Rom };
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Create and open an output file for writing direct from a dictionary
|
/// Create and open an output file for writing direct from a dictionary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user