CodeSmith 4.0 Getting Started - CodeSmith Announcements - CodeSmith Official - CodeSmith Community
Welcome to the CodeSmith Community!

CodeSmith 4.0 Getting Started

CodeSmith Official

CodeSmith Official Blogs

CodeSmith 4.0 Getting Started

Rate This
  • Comments 1

Here are some things to try in the CodeSmith 4.0 beta to get started with some of the new features:

  • Experiment with .csp files. You can find some samples in your "My Documents\CodeSmith\Samples\v4.0\Projects\CSharpCodeGeneratorSample" and "My Documents\CodeSmith\Samples\v4.0\Projects\VBCodeGeneratorSample" folders.
    • Open the Visual Studio project, right click on the .csp files, click Generate Outputs.
    • Try deleting the outputs and building the project to see the outputs automatically regenerated during build.
    • Try running the .csp files from windows explorer by right-clicking on the .csp files and clicking Generate Outputs.
    • Try adding new outputs.
  • Try using ActiveSnippets.
    • Try opening a file in Visual Studio and press CTRL-E, CTRL-R.  This will show you a list of available ActiveSnippets.  You can then type the name of one of them and press CTRL-E, CTRL-R again for detailed usage information on that snippet. 
    • Try opening a C# or VB file in Visual Studio and type "tp Petshop.dbo.Orders" and then press CTRL-E, CTRL-E. This should expand out to typed properties for all of the fields in the Orders table.
    • Try typing "cv MyEvent SomeProperty1=string;SomeProperty2=string" in a C# file and then press CTRL-E, CTRL-E
    • Look at how ActiveSnippets are setup by going to Tools / CodeSmith / ActiveSnippet Configuration dialog.
  • CodeSmith Map files.
    • Open CodeSmith Studio and goto View / Map Editor. Look at the included map files.
    • Open up the ActiveSnippets / CSharp / TableProperties.cst template and checkout the <%@ Map directive and how the map is being used in the template to convert full system data types to their C# keyword counterparts.
  • Extended Property management.
    • Open CodeSmith Studio and use the Schema Explorer tool window to browse your database schema objects. Then right click on an object and select Extended Properties. This will show you the list of extended properties already associated to the object. Any extended properties that start with CS_ are system extended properties and are read only. Try adding a new extended property.
    • These extended properties can be accessed in your templates and used to drive your code generation.

Screenshots

http://community.codesmithtools.com/photos/cs40/default.aspx

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • * Please enter your name
  • * Please enter a comment
  • Post
  • CodeSmith 4.0 Beta 2 has been released and is now available to the public.

Page 1 of 1 (1 items)