About/Contact

Steve Trefethen

Steve Trefethen is a Director of Engineering at Reply. Contact me

View my LinkedIn profile


Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?
$720 in referrals so far!


Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.



Modifying Generated Code Templates in Delphi 2005

December 13 2004 8:54PM

NOTE: This information falls under the use at your own risk category.  During the Internet Team chat session we recorded the other day the issue of being able to modify the code that the IDE generates when you create new WebForms came up and I mentioned that I would blog about it. Well, here is that blog entry. If you want to change the code that is generated for many of the different file types that the IDE creates you should look in your Delphi 2005 folder for a subfolder named ObjRepos which contains all of the template files that the IDE uses to generate File|New items.

For example, let's say you have a stylesheet that you always use for your HTML pages. You could change the template for HTML files to always link to your stylesheet so that you don't have to manually add it each time.  Here are the steps you would follow to make this change:

  1. Open the Delphi 2005\ObjRepos\Markup folder
  2. Find the file HTMLPageTemplage.htm and edit open using your favorite editor
  3. Add a LINK tag to the HEAD section of the page template file
  4. Save the changes

That's it!  You've now modified the default page template for HTML files to always include your own stylesheet.  Pretty sweet huh?  You can do the exact same thing for many other file types used by the IDE.  Another example is if you didn't want the ASP.NET debug settings in your machine.config file you could change the web.config file under .\objrepos\DelphiDotNet to include the same debug settings so that every ASP.NET application you create in Delphi will automatically have those settings (not necessarily a great idea because of deployment issues). For more information refer to this post.

I don't have a table which maps all of the files to there specific file types so you might have to do a bit of digging before you find the one you want.  Also, changing these files isn't supported so if you mess them up and your IDE no longer functions correctly either restore the files from the installation CD or reinstall the product.  Whatever you do don't come looking for me to fix the problem!  :)

FacebookDel.icio.usDigg It!

Tags:

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading