mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Add AssemblyName extension property to PE
This commit is contained in:
@@ -596,6 +596,25 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Name as derived from the assembly manifest
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If there are multiple identities included in the manifest,
|
||||
/// this will only retrieve the value from the first that doesn't
|
||||
/// have a null or empty name.
|
||||
/// </remarks>
|
||||
public string? AssemblyName
|
||||
{
|
||||
get
|
||||
{
|
||||
var manifest = GetAssemblyManifest();
|
||||
var identities = manifest?.AssemblyIdentities ?? [];
|
||||
var nameIdentity = Array.Find(identities, ai => !string.IsNullOrEmpty(ai?.Name));
|
||||
return nameIdentity?.Name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Version as derived from the assembly manifest
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user