MetadataProvider Class

Namespace
Kampute.DocToolkit.Metadata
Assembly
  • Kampute.DocToolkit.dll

Definition

Provides extension methods to retrieve metadata abstraction objects from reflection objects.
public static class MetadataProvider
Inheritance

Remarks

This static class offers extension methods for Assembly, Type, and various member reflection types to obtain their corresponding metadata abstractions. It manages internal caching to ensure that each reflection object maps to a single metadata object instance, optimizing memory usage and performance.

The class supports assemblies loaded both by the Common Language Runtime (CLR) and through Metadata Load Context (MLC). It automatically selects the appropriate factory for creating metadata objects based on the assembly's origin.

Thread Safety

Public static members of the type are guaranteed to be thread-safe.

Properties

AvailableAssembliesGets the assemblies for which metadata has been created.

Methods

ClearCache()Clears the internal caches of created metadata objects.
FindTypeByFullName(string)Searches for type metadata by its full name across all loaded assemblies.
GetMetadata(this Assembly)Retrieves metadata for an assembly.
GetMetadata(this Type)Retrieves metadata for a type.
GetMetadata<T>(this Type)Retrieves metadata for a type, cast to a specific type.
GetMetadata(this ConstructorInfo)Retrieves metadata for a constructor.
GetMetadata(this MethodInfo)Retrieves metadata for a method.
GetMetadata(this PropertyInfo)Retrieves metadata for a property.
GetMetadata(this EventInfo)Retrieves metadata for the specified event.
GetMetadata(this FieldInfo)Retrieves metadata for a field.
GetMetadata(this MemberInfo)Retrieves metadata for a member.
RegisterRuntimeAssemblies()Registers all assemblies currently loaded in the application domain.