May 2004
Intermediate to advanced
888 pages
22h 31m
English
Listing 15.2 is an example of reflecting Module classes of an assembly.
1: procedure TWinForm.ReflectModule(aModule: Module; aTn: TreeNode); 2: var 3: arType: array of System.Type; 4: arAttrib: array of System.Object; 5: arFields: array of FieldInfo; 6: arMeth: array of MethodInfo; 7: i: integer; 8: tn: TreeNode; 9: tni: TReeNode; 10: begin 11: tn := aTn.Nodes.Add(aModule.Name); 12: tn.Nodes.Add('Fully Qualified Name: '+aModule.FullyQualifiedName); 13: tn.Nodes.Add('Is Resource: '+ TObject(aModule.IsResource).ToString); 14: 15: // Examine custom attributes 16: tni := tn.Nodes.Add('Custom Attributes'); 17: arAttrib := aModule.GetCustomAttributes(true); 18: for i := Low(arAttrib) to High(arAttrib) ... |
Read now
Unlock full access