Namespace: Albatross.Reflection
Provides extension methods for Assembly objects to facilitate type discovery and resource management.
public static class AssemblyExtensions
Inheritance Object → AssemblyExtensions
Attributes NullableContextAttribute, NullableAttribute, ExtensionAttribute
Return all concrete classes that derive from base class T in an assembly
public static IEnumerable<Type> GetConcreteClasses<T>(Assembly assembly)
T
The base type to filter by
assembly
Assembly
The assembly to search
IEnumerable<Type>
An enumerable of concrete types that derive from T
Return all Concrete classes in an assembly
public static IEnumerable<Type> GetConcreteClasses(Assembly assembly)
assembly
Assembly
The assembly to search
IEnumerable<Type>
An enumerable of all concrete types in the assembly
Retrieves the content of an embedded resource file from the assembly. Uses the DefaultNamespaceAttribute if available, otherwise falls back to assembly name.
public static string GetEmbeddedFile(Type type, string name, string folder)
type
Type
A type from the assembly containing the embedded resource
name
String
The name of the embedded file
folder
String
The folder path within the assembly resources (default: “Embedded”)
String
The content of the embedded file as a string
ArgumentException
Thrown when the specified resource doesn’t exist
Remarks:
This method constructs the resource name as: {namespace}.{folder}.{name} If the assembly name doesn’t match the default namespace, use DefaultNamespaceAttribute.