mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Remove now-redundant As extensions
This commit is contained in:
@@ -152,20 +152,6 @@ namespace SabreTools.Data.Extensions
|
||||
// TODO: Implement other resource types from https://learn.microsoft.com/en-us/windows/win32/menurc/resource-file-formats
|
||||
#region Resources
|
||||
|
||||
/// <summary>
|
||||
/// Read resource data as an accelerator table resource
|
||||
/// </summary>
|
||||
/// <param name="entry">Resource data entry to parse into an accelerator table resource</param>
|
||||
/// <returns>A filled accelerator table resource on success, null on error</returns>
|
||||
public static AcceleratorTable? AsAcceleratorTableResource(this Models.PortableExecutable.Resource.DataEntry? entry)
|
||||
{
|
||||
// If we have data that's invalid for this resource type, we can't do anything
|
||||
if (entry?.Data is null || entry.Data.Length % 8 != 0)
|
||||
return null;
|
||||
|
||||
return Serialization.Readers.PortableExecutable.ParseAcceleratorTable(entry.Data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read resource data as a side-by-side assembly manifest
|
||||
/// </summary>
|
||||
@@ -188,20 +174,6 @@ namespace SabreTools.Data.Extensions
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read resource data as a dialog box
|
||||
/// </summary>
|
||||
/// <param name="entry">Resource data entry to parse into a dialog box</param>
|
||||
/// <returns>A filled dialog box on success, null on error</returns>
|
||||
public static DialogBoxResource? AsDialogBox(this Models.PortableExecutable.Resource.DataEntry? entry)
|
||||
{
|
||||
// If we have an invalid entry, just skip
|
||||
if (entry?.Data is null)
|
||||
return null;
|
||||
|
||||
return Serialization.Readers.PortableExecutable.ParseDialogBoxResource(entry.Data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read resource data as a font group
|
||||
/// </summary>
|
||||
@@ -271,34 +243,6 @@ namespace SabreTools.Data.Extensions
|
||||
return fontGroupHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read resource data as a menu
|
||||
/// </summary>
|
||||
/// <param name="entry">Resource data entry to parse into a menu</param>
|
||||
/// <returns>A filled menu on success, null on error</returns>
|
||||
public static MenuResource? AsMenu(this Models.PortableExecutable.Resource.DataEntry? entry)
|
||||
{
|
||||
// If we have an invalid entry, just skip
|
||||
if (entry?.Data is null)
|
||||
return null;
|
||||
|
||||
return Serialization.Readers.PortableExecutable.ParseMenuResource(entry.Data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read resource data as a message table resource
|
||||
/// </summary>
|
||||
/// <param name="entry">Resource data entry to parse into a message table resource</param>
|
||||
/// <returns>A filled message table resource on success, null on error</returns>
|
||||
public static MessageResourceData? AsMessageResourceData(this Models.PortableExecutable.Resource.DataEntry? entry)
|
||||
{
|
||||
// If we have an invalid entry, just skip
|
||||
if (entry?.Data is null)
|
||||
return null;
|
||||
|
||||
return Serialization.Readers.PortableExecutable.ParseMessageResourceData(entry.Data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read byte data as a string file info resource
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user