A Class Browser ApplicationThe following sample application implements a .NET Framework-based class browser, using the System.Reflection APIs to gather information about a class. To simplify the .aspx code, the application employs a managed component that encapsulates the reflection details. The .aspx page itself relies heavily on several DataList controls for rendering the namespaces, classes, and class details. The sample also shows the use of nested DataList controls for rendering the parameter lists. To view the sample, click the icon below.
The class browser also uses the ASP.NET configuration system to determine which modules to load and reflect upon. A configuration section is mapped to the HashtableSectionHandler, which maintains key/value pairs for the assembly name and file. You can add assemblies to this list by appending a line to the class browser application's configuration section, as follows:
<configuration>
<configSections>
<sectionGroup name="system.web">
<section name="ClassBrowser" type="System.Configuration.NameValueSectionHandler,
System,Version=1.0.3300.0,Culture=neutral,PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
</configSections>
<system.web>
<ClassBrowser>
<add key="ASP.NET Class Library" value="System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add key=".NET Framework class Library" value="mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</ClassBrowser>
</system.web>
</configuration>
|