tag:blogger.com,1999:blog-5602263760491785758.post5176849533324372293..comments2023-06-28T01:39:03.668-07:00Comments on DevArchive.net Blog: Code Generation Using Custom Item Template, Custom Template Wizard and T4 EngineKirill Chilingarashvilihttp://www.blogger.com/profile/09906215698720468631noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-5602263760491785758.post-25257615906171948372012-03-27T03:16:20.125-07:002012-03-27T03:16:20.125-07:00Hi Mayur, I am fine thanks,
hope you too.
This is...Hi Mayur, I am fine thanks,<br />hope you too.<br /><br />This is possible - the item template in the sample code for the post also adds more than one item<br /><br />Here is another sample<br /><br /><br /> <br /> MaintenanceScreen<br /> MaintenanceScreen<br /> Creates Maintenance Screen for Protech<br /> CSharp<br /> 10<br /> __TemplateIcon.ico<br /> <br /> <br /> <br /> View.xaml<br /> View.xaml.cs<br /> EditView.xaml<br /> EditView.xaml.cs<br /> ViewModel.csKirill Chilingarashvilihttps://www.blogger.com/profile/09906215698720468631noreply@blogger.comtag:blogger.com,1999:blog-5602263760491785758.post-67329678646726438462012-03-27T03:10:28.792-07:002012-03-27T03:10:28.792-07:00Hi Kirill,
Its been so long we talked. How are yo...Hi Kirill,<br /><br />Its been so long we talked. How are you?<br /><br />Well I wanted to know that can we add more than one Item into the project using Item Template? For eg. Currently it is adding only one Item to my project, suppose WindowsForm1", But I also wanted to add a Global file, GlobalFile.cs, in my project. So how can I create my Item template so that it will add more than one items.<br /><br />If it is not possible using Item Template to add more than one item, then please suggest a method to do this. I don't want to use Project Template.<br /><br />Regards,<br />Mayur MahajanMayur Mahajanhttps://www.blogger.com/profile/12541528659657197028noreply@blogger.comtag:blogger.com,1999:blog-5602263760491785758.post-88710274751790152942012-01-19T02:04:49.736-08:002012-01-19T02:04:49.736-08:00Kirill,
Actually I am not getting how you gets the...Kirill,<br />Actually I am not getting how you gets the dll from the Windows application and how you are registering your dll into the GAC directly after post build. Will you plz explain this in some detail?<br /> To get the dll I have another Class Library project. Now my application works fine but I have an issue while updating the dll. If I made some changes to my dll then the new changes are not reflected in the Wizard. For this I have unregistered the previous dll and registered the new one. I think the previous dll gets stored in the memory.<br /> Please provide me solution for this issue and plz provide explaination for the above que in first paragraph..!<br /><br />Thanks & Regards,<br />Mayur MahajanMayur Mahajanhttps://www.blogger.com/profile/12541528659657197028noreply@blogger.comtag:blogger.com,1999:blog-5602263760491785758.post-64799078094127467022012-01-17T21:28:26.370-08:002012-01-17T21:28:26.370-08:00Hi Mayur
Templating Engine can reference assembli...Hi Mayur<br /><br />Templating Engine can reference assemblies from GAC only - as I remember<br />If you download code for this article - you will see that in post build event the assemblies are registered in GAC<br /><br />Regards,<br />KirillKirill Chilingarashvilihttps://www.blogger.com/profile/09906215698720468631noreply@blogger.comtag:blogger.com,1999:blog-5602263760491785758.post-16493260109726098872012-01-17T07:51:48.961-08:002012-01-17T07:51:48.961-08:00Hello,
I am creating a Windows Application. ...Hello,<br /><br /> I am creating a Windows Application. In that I am using T4 Templates.<br /> In T4 templates I have a code which uses some of the static properties and methods of some class from the same project. But when I tries to add reference to that class I get the error as : "[b]Compiling transformation: Invalid reference option: 'WindowsWIzard' -- cannot reference directories[/b]"<br /> The code I have written in .tt file is as follows :<br /><br /><#@ template language="C#" hostspecific="True" debug="True" #> <br /><#@ output extension="?" #> <br /><#@ assembly name="Microsoft.VisualBasic" #><br /><#@ assembly name="WindowsWizard" #><br /><#@ import namespace="WindowsWizard" #><br /><#@ import namespace="WindowsWizard.Templates" #><br /><#@ include file="T4Toolbox.tt" #><br /><#@ include file="CrudProcedureGenerator.tt" #><br /><#@ include file="DeleteProcedureTemplate.tt" #><br /><#@ include file="InsertProcedureTemplate.tt" #><br /><#@ include file="UpdateProcedureTemplate.tt" #><br /><br /><# <br /> <br /> CrudProcedureGenerator generator = new CrudProcedureGenerator(); <br /> generator.DatabaseName = GenerateCode.SendDBName;<br /> generator.Run();<br />#><br /><br />Here the code block in the standard directives is working fine as I have checked it in another demo application. It is refering above .tt files in include directive. WindowsWIzard is the name of my project i.e. assembly.<br /><br />Am I doing something wrong? How can I refer refer methods from another Class into the template?Mayur Mahajanhttps://www.blogger.com/profile/12541528659657197028noreply@blogger.comtag:blogger.com,1999:blog-5602263760491785758.post-49616574135225720992012-01-12T04:46:32.932-08:002012-01-12T04:46:32.932-08:00Thanks a lot Kirill. The above link does not cover...Thanks a lot Kirill. The above link does not covers much about what I wanted but as you suggested I searched for "IWizard and how to use it" and then I got one link which I should mention here for others people trying to that. The link is : "http://www.bluelemoncode.com/post/2012/01/05/Creating-custom-project-and-file-template-with-wizard-for-Visual-Studio.aspx".<br />This link is very good and explains well about the Wizard creation for the Templates.<br />Also go through the link "http://blog.devarchive.net/2010/10/code-generation-using-custom-item.html".<br /><br />Thanks a lot once again Kirill.Mayur Mahajanhttps://www.blogger.com/profile/12541528659657197028noreply@blogger.comtag:blogger.com,1999:blog-5602263760491785758.post-73780043857442427392012-01-04T10:30:55.351-08:002012-01-04T10:30:55.351-08:00Hi Mayur,
you can look for more info here:
http:/...Hi Mayur,<br /><br />you can look for more info here:<br />http://msdn.microsoft.com/en-us/magazine/cc188697.aspx<br />please search IWIzard and how to use it.<br />I did not read the article but it seems it covers that.<br />I used another reasource from MSDN when created this - but that resource disappeared from msdn :(<br />That is why the link does not work anymore<br /><br />anyway try new link - it seems to cover that as well<br /><br />Cheers,<br />KirillKirill Chilingarashvilihttps://www.blogger.com/profile/09906215698720468631noreply@blogger.comtag:blogger.com,1999:blog-5602263760491785758.post-28848614681424300192012-01-04T07:14:11.259-08:002012-01-04T07:14:11.259-08:00Kirill,
the above post is the best post of all. I...Kirill,<br /><br />the above post is the best post of all. I wanted to do the same thing and after reading your post i got some hope that this can be done. But I am not getting one thing that :<br /><br />How do you call your wizard when we select the template from "File-->Add new Item". I wanted to call my own User Interface. How should I achieve this?Mayur Mahajanhttps://www.blogger.com/profile/12541528659657197028noreply@blogger.comtag:blogger.com,1999:blog-5602263760491785758.post-15212936726277224812010-12-07T05:48:44.063-08:002010-12-07T05:48:44.063-08:00Great! Thank you - it is very good post.Great! Thank you - it is very good post.XNA Gamerhttps://www.blogger.com/profile/07209691595502469158noreply@blogger.com