Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes you can. This MSDN article <a href="http://msdn.microsoft.com/en-us/library/s365byhx.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/s365byhx.aspx</a> has links to several approaches to achieve this.</p> <p>I think the easiest way is to make a file with the template that you want, substitue parameters and export the template. In your example create a new class with the existing template</p> <pre><code> namespace Foo { public class Bar { } } </code></pre> <p>Swap out the variable parts of this. ie the namespace name 'Foo' and the class name 'Bar'</p> <pre><code> namespace $rootnamespace$ { public class $safeitemrootname$ { } } </code></pre> <p>Save the change</p> <ul> <li>You can now go File -> Export Template. Select Item Template (click Next) </li> <li>Select the file you created for this example (click Next) </li> <li>Select any item references you want to add to the project. In this<br> case there aren't any (click next)</li> <li>Enter a Template Name (ie PublicClass). This is what the file will be called in the new file dialog. Also what the default file will be called on creation</li> </ul> <p>This will create a zip file in {userpath}/My Documents/Visual Studio 2010/My Exported Templates. You do not need to run as admin or run any other tools. VS will automatically pull this up from the this path.</p> <p>I realise this doesn't replace the existing option. If you want to do this I would use the same process, use the same Item Name as the default Item Name. In this case class. I would use the path and registration process defined by @James Hill</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload