The SchemaExplorer object model
Starting from a DatabaseSchema object, you can drill down through the SchemaExplorer object model to find out about the contents of the database the user selected. This diagram shows the major parts of the model:

SchemaExplorer provides collections, objects and properties that match this model. For example, the Commands property of a DatabaseSchema returns a CommandSchemaCollection. Its Item property gives you individual CommandSchema objects, one for each command (stored procedure) in the database. The properties of each CommandSchema give you the details of the command, so you can retrieve the metadata you need to generate code from it.
For the full list of classes and members, see the CodeSmith Generator API reference.