<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>The Efficient Coder</title>
    <link>http://www.efficientcoder.net/</link>
    <description>There has got to be a better way of communicating with our computers!</description>
    <language>en-us</language>
    <copyright>Kevin D. Wolf</copyright>
    <lastBuildDate>Fri, 27 Feb 2009 17:06:05 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>kevinw@software-logistics.com</managingEditor>
    <webMaster>kevinw@software-logistics.com</webMaster>
    <item>
      <trackback:ping>http://www.efficientcoder.net/Trackback.aspx?guid=64336e85-5741-4650-801e-78eddb7cfb48</trackback:ping>
      <pingback:server>http://www.efficientcoder.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.efficientcoder.net/PermaLink,guid,64336e85-5741-4650-801e-78eddb7cfb48.aspx</pingback:target>
      <dc:creator>kevinw@software-logistics.com (Kevin D. Wolf)</dc:creator>
      <wfw:comment>http://www.efficientcoder.net/CommentView,guid,64336e85-5741-4650-801e-78eddb7cfb48.aspx</wfw:comment>
      <wfw:commentRss>http://www.efficientcoder.net/SyndicationService.asmx/GetEntryCommentsRss?guid=64336e85-5741-4650-801e-78eddb7cfb48</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <font size="4" face="Times New Roman">I'm
   building a multi-tier application in JavaScript.  This is implementing the <a href="http://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx">Model
   View ViewModel</a> pattern to keep as much of the code generic as possible, while
   allowing for customizations in both the UI and data layers for specific browsers and
   data access methods such as a local SQLLite database or calls to the server. 
   I'm using code-generation </font>
        <font size="4" face="Times New Roman">to create my
   models, but need a good way to create the Controllers, Views, and ViewModels. </font>
        <font size="4" face="Times New Roman">
        </font>
        <font size="4" face="Times New Roman">I
   had been using a simple template, but cutting, pasting and replacing text seemed a
   little inefficient, so I decided to create some Visual Studio Templates to accomplish
   this goal.<br /></font>
        <br />
        <font size="4" face="Times New Roman">It's fairly simple to create a <a href="http://msdn.microsoft.com/en-us/library/tsyyf0yh.aspx">trivial
   template</a>, but I needed to add just bit more complexity, I need to build up a custom
   namespace for my classes, so just a simple ZIP file containing my template didn't
   cut it.  The answer was to implement <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.templatewizard.iwizard.aspx">IWizard</a> in
   the Microsoft.VisualStudio.TemplateWizard namespace<br /><br />
   We need to create two components for our new templates, a ZipFile containing, *.vstemplate
   and a .NET Assembly containing the IWizard implementation.<br /><br /><font size="5"><b><font face="Arial">Create your IWizard Implementation</font></b></font><br />
   1) Create a Windows Class Library<br />
   2) Add the following References<br /></font>
        <ul>
          <li>
            <font size="4" face="Times New Roman">EnvDTE</font>
          </li>
          <li>
            <font size="4" face="Times New Roman">Microsoft.VisualStudio.TemplateWizardInterface</font>
          </li>
        </ul>
        <font size="4" face="Times New Roman">3) Create an empty class, and implement the
   interface <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.templatewizard.iwizard.aspx">Microsoft.VisualStudio.TemplateWizard.IWizard</a><br />
   4) The method you care most about is:</font>
        <br />
        <font face="Courier New">      public void RunStarted(<font color="#0000ff">object</font> automationObject, <font color="#0000ff">Dictionary</font>&lt;<font color="#000080">string</font>, <font color="#000080">string</font>&gt;
   replacementsDictionary, Microsoft.VisualStudio.TemplateWizard.<font color="#0000ff">WizardRunKind</font> runKind, <font color="#0000ff">object</font>[]
   customParams)</font>
        <br />
        <br />
        <font size="4" face="Times New Roman">5) In this method you can add additional tokens
   to be used in your template by adding name value pairs to the replacementDictionary<br /></font>          <font face="Courier New">replacementsDictionary.Add("<font color="#ff0000">$modulename$</font>",
   "<font color="#ff0000">MyName</font>");</font><br /><br /><font size="4" face="Times New Roman">6) In addition you can add a standard windows
   form to your wizard to collect information<br /></font><font face="Courier New">      _inputForm = new <font color="#008000">ModuleInputForm</font>();</font><br /><font face="Courier New">      _inputForm.ShowDialog();</font><br /><br /><font face="Courier New">      replacementsDictionary.Add("<font color="#ff0000">$modulename$</font>",
   _inputForm.ModuleName);</font><br /><br /><font size="4" face="Times New Roman">7) Within the Project Properties and the Signing
   Tab, you need <a href="http://msdn.microsoft.com/en-us/library/ms247123%28VS.80%29.aspx">sign</a> your
   assembly.  You will be installing within the GAC, so it needs a strong name.<br />
   8) <a href="http://support.microsoft.com/kb/815808">Install</a> your Assembly in the
   GAC.  The easiest way to do this is to just copy the file from your build output
   directory to %WINDIR%\assemblies between two explorer windows.<br /></font><font size="4" face="Times New Roman">9) After you install your Assembly note
   the <b>Assembly Name</b> and <b>Public Key Token</b>, you will need these to create
   your vstemplate.</font><br /><br /><div align="center"><img src="http://www.efficientcoder.net/content/binary/StrongName.jpg" border="0" /><br /></div><font size="4" face="Times New Roman"><br />
   10) If you make updates to your wizard, you have to make sure you close all instances
   of Visual Studio .NET so your wizard is reloaded.<br /><br /><b><font size="5" face="Arial">Create your vstemplate:</font></b><br />
   We will need to create a ZIP file that contains at least three components (more if
   you want to generate multiple files):<br />
   1) SomeTemplate.ext - This will contain the template used to create the Visual Studio
   Project Item<br />
   2) Specification.vstemplate - An XML file that contains the configuration for your
   template<br />
   3) Image.ico - An image that will be displayed in the new project item dialog for
   your custom project template.<br /><br />
   What I did was just create a temp directory where I created these files.  Once
   complete I'll zip them up and show you where to put them so Visual Studio will recognize
   them.<br /><br /><font face="Arial"><b> SomeTemplate.ext</b></font>, or in my case Controller.js<br />
   This is your custom template.  It can contain anything, but what makes this work
   is the ability to replace tokens within the template.  I wanted to use a custom
   module name and class name within my JavaScript files, this is only a fragment from
   the file, but you get the idea.<br /><br /></font><font face="Courier New">MyCompany.Controllers.$modulename$.$safeitemname$.registerClass('</font><font face="Courier New">MyCompany</font><font face="Courier New">.Controllers.$modulename$.$safeitemname$',
   null, Sys.IDisposable, </font><font face="Courier New">MyCompany</font><font face="Courier New">.Controllers.IController);</font><br /><br /><font size="4" face="Times New Roman"><b><font size="4" face="Arial">Specification.vstemplate</font></b> or
   in my case </font>Controller.vstemplate<br /><font size="4" face="Times New Roman">Next we need to create our .vstemplate file. 
   This is a small XML file that tells Visual Studio how to build your populated instance
   of the template, it's format is as follows: </font><br /><br /><font face="Courier New">&lt;VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"
   Type="Item"&gt;<br />
     &lt;TemplateData&gt;<br />
       &lt;DefaultName&gt;Controller.js&lt;/DefaultName&gt;<br />
       &lt;Name&gt;M-V-VM Controller&lt;/Name&gt;<br />
       &lt;Description&gt;Model View ViewModel Controller&lt;/Description&gt;<br />
       &lt;ProjectType&gt;CSharp&lt;/ProjectType&gt;<br />
       &lt;SortOrder&gt;10&lt;/SortOrder&gt;<br />
       &lt;Icon&gt;__TemplateIcon.ico&lt;/Icon&gt;<br />
     &lt;/TemplateData&gt;<br />
     &lt;TemplateContent&gt;<br />
       &lt;References /&gt;<br />
       &lt;ProjectItem SubType="" TargetFileName="$fileinputname$.js"
   ReplaceParameters="true"&gt;Controller.js&lt;/ProjectItem&gt;<br />
     &lt;/TemplateContent&gt;<br />
     &lt;WizardExtension&gt;<br />
       &lt;Assembly&gt;MyCompany.</font><font face="Courier New">Templates.</font><font face="Courier New">WizardTemplateInstance,
   Version=1.0.0.0, Culture=Neutral, PublicKeyToken=a2c453bf57a7f5d7&lt;/Assembly&gt;<br />
       &lt;FullClassName&gt;</font><font face="Courier New">MyCompany.Templates.WizardTemplateInstance</font><font face="Courier New">&lt;/FullClassName&gt;<br />
     &lt;/WizardExtension&gt;<br />
   &lt;/VSTemplate&gt;</font><br /><br /><font size="4" face="Times New Roman">Pretty straight forward. but <a href="http://msdn.microsoft.com/en-us/library/xwkxbww4.aspx">here's
   a little more information</a> about the file format, one important note, make sure
   in your ProjectItem node, you have ReplaceParameters="true" to update your tokens. 
   In addition to the custom tokens we added in the wizard we created above, here is
   a <a href="http://msdn.microsoft.com/en-us/library/eehb4faa.aspx">list</a> of built
   in tokens.<br /><br />
   You need to find yourself an icon for your template.  Make sure it's in the same
   directory and is specified by the &lt;Icon&gt; node.<br /><br />
   Once you have this completed, zip all three files and place them in the directory
   on your machine similar to:<br />
        <font face="Courier New">[USERNAME]\Documents\Visual Studio
   2008\Templates\ItemTemplates</font><br /><br /><b><font size="5" face="Arial">Generate your Template</font></b><br />
   Start Visual Studio, within your solution tree, click on Add New Item and in the bottom
   section on MyTemplates you should see the following:</font><br /><div align="center"><img src="content/binary/NewItem.jpg" border="0" /><br /></div><font size="4" face="Times New Roman">Change the name and if the Software God's are
   shining on you you should see:</font><br /><br /><div align="center"><img src="content/binary/ModuleName.jpg" border="0" /><br /></div><font size="4" face="Times New Roman"><br />
   where you can enter the name of your module.<br /><br />
   Once you hit Save, your new file should get generated any tokens you specified be
   replaced.  In my case here is a portion of the generated file with the module
   name of "Sync" and file name of "History" is as follows:<br /></font><br /><font face="Courier New">MyCompany.Controllers.$modulename$.$safeitemname$.registerClass('</font><font face="Courier New">MyCompany</font><font face="Courier New">.Controllers.$modulename$.$safeitemname$',
   null, Sys.IDisposable, </font><font face="Courier New">MyCompany</font><font face="Courier New">.Controllers.IController);</font><br /><font face="Courier New">MyCompany.Controllers.Sync.History.registerClass('<font color="#ff0000">MyCompany.Controllers.Sync.History</font>',
   MyCompany.Controllers.ControllerBase, Sys.IDisposable, MyCompany.Controllers.IController);</font><br /><br /><div align="center"><i>Yes that is Javascript, if you are doing client side programming,
      why aren't you taking advantage of the <a href="http://msdn.microsoft.com/en-us/library/bb397536.aspx">Microsoft
      Ajax Client Library</a>?</i><br /></div><br /><br />
   -ec<br /><img width="0" height="0" src="http://www.efficientcoder.net/aggbug.ashx?id=64336e85-5741-4650-801e-78eddb7cfb48" /></body>
      <title>Creating Project Item Templates in Visual Studio</title>
      <guid>http://www.efficientcoder.net/PermaLink,guid,64336e85-5741-4650-801e-78eddb7cfb48.aspx</guid>
      <link>http://www.efficientcoder.net/PermaLink,guid,64336e85-5741-4650-801e-78eddb7cfb48.aspx</link>
      <pubDate>Fri, 27 Feb 2009 17:06:05 GMT</pubDate>
      <description>&lt;font size="4" face="Times New Roman"&gt;I'm building a multi-tier application in JavaScript.&amp;nbsp;
This is implementing the &lt;a href="http://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx"&gt;Model
View ViewModel&lt;/a&gt; pattern to keep as much of the code generic as possible, while
allowing for customizations in both the UI and data layers for specific browsers and
data access methods such as a local SQLLite database or calls to the server.&amp;nbsp;
I'm using code-generation &lt;/font&gt;&lt;font size="4" face="Times New Roman"&gt;to create my
models, but need a good way to create the Controllers, Views, and ViewModels.&amp;nbsp;&lt;/font&gt;&lt;font size="4" face="Times New Roman"&gt; &lt;/font&gt;&lt;font size="4" face="Times New Roman"&gt;I
had been using a simple template, but cutting, pasting and replacing text seemed a
little inefficient, so I decided to create some Visual Studio Templates to accomplish
this goal.&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;
&lt;font size="4" face="Times New Roman"&gt;It's fairly simple to create a &lt;a href="http://msdn.microsoft.com/en-us/library/tsyyf0yh.aspx"&gt;trivial
template&lt;/a&gt;, but I needed to add just bit more complexity, I need to build up a custom
namespace for my classes, so just a simple ZIP file containing my template didn't
cut it.&amp;nbsp; The answer was to implement &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.templatewizard.iwizard.aspx"&gt;IWizard&lt;/a&gt; in
the Microsoft.VisualStudio.TemplateWizard namespace&lt;br&gt;
&lt;br&gt;
We need to create two components for our new templates, a ZipFile containing, *.vstemplate
and a .NET Assembly containing the IWizard implementation.&lt;br&gt;
&lt;br&gt;
&lt;font size="5"&gt;&lt;b&gt;&lt;font face="Arial"&gt;Create your IWizard Implementation&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;
&lt;br&gt;
1) Create a Windows Class Library&lt;br&gt;
2) Add the following References&lt;br&gt;
&lt;/font&gt;
&lt;ul&gt;
   &lt;li&gt;
      &lt;font size="4" face="Times New Roman"&gt;EnvDTE&lt;/font&gt;
   &lt;/li&gt;
   &lt;li&gt;
      &lt;font size="4" face="Times New Roman"&gt;Microsoft.VisualStudio.TemplateWizardInterface&lt;/font&gt;
   &lt;/li&gt;
&lt;/ul&gt;
&lt;font size="4" face="Times New Roman"&gt;3) Create an empty class, and implement the
interface &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.templatewizard.iwizard.aspx"&gt;Microsoft.VisualStudio.TemplateWizard.IWizard&lt;/a&gt;
&lt;br&gt;
4) The method you care most about is:&lt;/font&gt; 
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void RunStarted(&lt;font color="#0000ff"&gt;object&lt;/font&gt; automationObject, &lt;font color="#0000ff"&gt;Dictionary&lt;/font&gt;&amp;lt;&lt;font color="#000080"&gt;string&lt;/font&gt;, &lt;font color="#000080"&gt;string&lt;/font&gt;&amp;gt;
replacementsDictionary, Microsoft.VisualStudio.TemplateWizard.&lt;font color="#0000ff"&gt;WizardRunKind&lt;/font&gt; runKind, &lt;font color="#0000ff"&gt;object&lt;/font&gt;[]
customParams)&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font size="4" face="Times New Roman"&gt;5) In this method you can add additional tokens
to be used in your template by adding name value pairs to the replacementDictionary&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font face="Courier New"&gt;replacementsDictionary.Add("&lt;font color="#ff0000"&gt;$modulename$&lt;/font&gt;",
"&lt;font color="#ff0000"&gt;MyName&lt;/font&gt;");&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font size="4" face="Times New Roman"&gt;6) In addition you can add a standard windows
form to your wizard to collect information&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _inputForm = new &lt;font color="#008000"&gt;ModuleInputForm&lt;/font&gt;();&lt;/font&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _inputForm.ShowDialog();&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replacementsDictionary.Add("&lt;font color="#ff0000"&gt;$modulename$&lt;/font&gt;",
_inputForm.ModuleName);&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font size="4" face="Times New Roman"&gt;7) Within the Project Properties and the Signing
Tab, you need &lt;a href="http://msdn.microsoft.com/en-us/library/ms247123%28VS.80%29.aspx"&gt;sign&lt;/a&gt; your
assembly.&amp;nbsp; You will be installing within the GAC, so it needs a strong name.&lt;br&gt;
8) &lt;a href="http://support.microsoft.com/kb/815808"&gt;Install&lt;/a&gt; your Assembly in the
GAC.&amp;nbsp; The easiest way to do this is to just copy the file from your build output
directory to %WINDIR%\assemblies between two explorer windows.&lt;br&gt;
&lt;/font&gt;&lt;font size="4" face="Times New Roman"&gt;9) After you install your Assembly note
the &lt;b&gt;Assembly Name&lt;/b&gt; and &lt;b&gt;Public Key Token&lt;/b&gt;, you will need these to create
your vstemplate.&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;div align="center"&gt;&lt;img src="http://www.efficientcoder.net/content/binary/StrongName.jpg" border="0"&gt;
   &lt;br&gt;
&lt;/div&gt;
&lt;font size="4" face="Times New Roman"&gt;
&lt;br&gt;
10) If you make updates to your wizard, you have to make sure you close all instances
of Visual Studio .NET so your wizard is reloaded.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;&lt;font size="5" face="Arial"&gt;Create your vstemplate:&lt;/font&gt;&lt;/b&gt;
&lt;br&gt;
We will need to create a ZIP file that contains at least three components (more if
you want to generate multiple files):&lt;br&gt;
1) SomeTemplate.ext - This will contain the template used to create the Visual Studio
Project Item&lt;br&gt;
2) Specification.vstemplate - An XML file that contains the configuration for your
template&lt;br&gt;
3) Image.ico - An image that will be displayed in the new project item dialog for
your custom project template.&lt;br&gt;
&lt;br&gt;
What I did was just create a temp directory where I created these files.&amp;nbsp; Once
complete I'll zip them up and show you where to put them so Visual Studio will recognize
them.&lt;br&gt;
&lt;br&gt;
&lt;font face="Arial"&gt;&lt;b&gt; SomeTemplate.ext&lt;/b&gt;&lt;/font&gt;, or in my case Controller.js&lt;br&gt;
This is your custom template.&amp;nbsp; It can contain anything, but what makes this work
is the ability to replace tokens within the template.&amp;nbsp; I wanted to use a custom
module name and class name within my JavaScript files, this is only a fragment from
the file, but you get the idea.&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;MyCompany.Controllers.$modulename$.$safeitemname$.registerClass('&lt;/font&gt;&lt;font face="Courier New"&gt;MyCompany&lt;/font&gt;&lt;font face="Courier New"&gt;.Controllers.$modulename$.$safeitemname$',
null, Sys.IDisposable, &lt;/font&gt;&lt;font face="Courier New"&gt;MyCompany&lt;/font&gt;&lt;font face="Courier New"&gt;.Controllers.IController);&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font size="4" face="Times New Roman"&gt;&lt;b&gt;&lt;font size="4" face="Arial"&gt;Specification.vstemplate&lt;/font&gt;&lt;/b&gt; or
in my case &lt;/font&gt;Controller.vstemplate&lt;br&gt;
&lt;font size="4" face="Times New Roman"&gt;Next we need to create our .vstemplate file.&amp;nbsp;
This is a small XML file that tells Visual Studio how to build your populated instance
of the template, it's format is as follows: &lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;lt;VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"
Type="Item"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;TemplateData&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DefaultName&amp;gt;Controller.js&amp;lt;/DefaultName&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name&amp;gt;M-V-VM Controller&amp;lt;/Name&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Description&amp;gt;Model View ViewModel Controller&amp;lt;/Description&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ProjectType&amp;gt;CSharp&amp;lt;/ProjectType&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SortOrder&amp;gt;10&amp;lt;/SortOrder&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Icon&amp;gt;__TemplateIcon.ico&amp;lt;/Icon&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/TemplateData&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;TemplateContent&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;References /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ProjectItem SubType="" TargetFileName="$fileinputname$.js"
ReplaceParameters="true"&amp;gt;Controller.js&amp;lt;/ProjectItem&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/TemplateContent&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;WizardExtension&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Assembly&amp;gt;MyCompany.&lt;/font&gt;&lt;font face="Courier New"&gt;Templates.&lt;/font&gt;&lt;font face="Courier New"&gt;WizardTemplateInstance,
Version=1.0.0.0, Culture=Neutral, PublicKeyToken=a2c453bf57a7f5d7&amp;lt;/Assembly&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FullClassName&amp;gt;&lt;/font&gt;&lt;font face="Courier New"&gt;MyCompany.Templates.WizardTemplateInstance&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;lt;/FullClassName&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/WizardExtension&amp;gt;&lt;br&gt;
&amp;lt;/VSTemplate&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font size="4" face="Times New Roman"&gt;Pretty straight forward. but &lt;a href="http://msdn.microsoft.com/en-us/library/xwkxbww4.aspx"&gt;here's
a little more information&lt;/a&gt; about the file format, one important note, make sure
in your ProjectItem node, you have ReplaceParameters="true" to update your tokens.&amp;nbsp;
In addition to the custom tokens we added in the wizard we created above, here is
a &lt;a href="http://msdn.microsoft.com/en-us/library/eehb4faa.aspx"&gt;list&lt;/a&gt; of built
in tokens.&lt;br&gt;
&lt;br&gt;
You need to find yourself an icon for your template.&amp;nbsp; Make sure it's in the same
directory and is specified by the &amp;lt;Icon&amp;gt; node.&lt;br&gt;
&lt;br&gt;
Once you have this completed, zip all three files and place them in the directory
on your machine similar to:&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font face="Courier New"&gt;[USERNAME]\Documents\Visual Studio
2008\Templates\ItemTemplates&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;&lt;font size="5" face="Arial"&gt;Generate your Template&lt;/font&gt;&lt;/b&gt;
&lt;br&gt;
Start Visual Studio, within your solution tree, click on Add New Item and in the bottom
section on MyTemplates you should see the following:&lt;/font&gt;
&lt;br&gt;
&lt;div align="center"&gt;&lt;img src="content/binary/NewItem.jpg" border="0"&gt;
   &lt;br&gt;
&lt;/div&gt;
&lt;font size="4" face="Times New Roman"&gt;Change the name and if the Software God's are
shining on you you should see:&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;div align="center"&gt;&lt;img src="content/binary/ModuleName.jpg" border="0"&gt;
   &lt;br&gt;
&lt;/div&gt;
&lt;font size="4" face="Times New Roman"&gt;
&lt;br&gt;
where you can enter the name of your module.&lt;br&gt;
&lt;br&gt;
Once you hit Save, your new file should get generated any tokens you specified be
replaced.&amp;nbsp; In my case here is a portion of the generated file with the module
name of "Sync" and file name of "History" is as follows:&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;MyCompany.Controllers.$modulename$.$safeitemname$.registerClass('&lt;/font&gt;&lt;font face="Courier New"&gt;MyCompany&lt;/font&gt;&lt;font face="Courier New"&gt;.Controllers.$modulename$.$safeitemname$',
null, Sys.IDisposable, &lt;/font&gt;&lt;font face="Courier New"&gt;MyCompany&lt;/font&gt;&lt;font face="Courier New"&gt;.Controllers.IController);&lt;/font&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;MyCompany.Controllers.Sync.History.registerClass('&lt;font color="#ff0000"&gt;MyCompany.Controllers.Sync.History&lt;/font&gt;',
MyCompany.Controllers.ControllerBase, Sys.IDisposable, MyCompany.Controllers.IController);&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;div align="center"&gt;&lt;i&gt;Yes that is Javascript, if you are doing client side programming,
   why aren't you taking advantage of the &lt;a href="http://msdn.microsoft.com/en-us/library/bb397536.aspx"&gt;Microsoft
   Ajax Client Library&lt;/a&gt;?&lt;/i&gt;
   &lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
-ec&lt;br&gt;
&lt;img width="0" height="0" src="http://www.efficientcoder.net/aggbug.ashx?id=64336e85-5741-4650-801e-78eddb7cfb48" /&gt;</description>
      <comments>http://www.efficientcoder.net/CommentView,guid,64336e85-5741-4650-801e-78eddb7cfb48.aspx</comments>
      <category>Software Engineering;Code Generation</category>
    </item>
  </channel>
</rss>