Reflecting an Assembly

Chapter 8 discusses assemblies and how they contain metadata about the types contained in them. This section discusses reflecting the assembly itself. The following sections show how to drill down further into the assembly’s modules, extracting detailed information about their structure and contents.

The Assembly class itself contains several properties and methods that you can use to reflect information about it. Listing 15.1 illustrates some of these methods.

Listing 15.1. Example of Reflecting an Assembly
1: procedure TWinForm.ReflectAssembly(aAssembly: Assembly); 2: var 3: arModule: array of Module; 4: i: integer; 5: tn: TreeNode; 6: tni: TreeNode; 7: arAttrib: array of System.Object; 8: arAsmName: array of AssemblyName; ...

Get Delphi for .NET Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.