How to pass string from IWizrad run started method to razor mvc project template (.cshtml file) http://forums.asp.net/t/1793282.aspx/1?How+to+pass+string+from+IWizrad+run+started+method+to+razor+mvc+project+template+cshtml+file+Tue, 17 Apr 2012 03:45:40 -040017932824934277http://forums.asp.net/p/1793282/4934277.aspx/1?How+to+pass+string+from+IWizrad+run+started+method+to+razor+mvc+project+template+cshtml+file+How to pass string from IWizrad run started method to razor mvc project template (.cshtml file) <p>i have one razor mvc project template with wizard concept. i want to pass some string from wizard application to .cshtml file. i have passed using RunStarted method of wizard application. Please check code below.</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> </p> <p><span style="border-width:0px; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; margin-bottom:0px; padding-bottom:0px; font-size:13px; line-height:16px; text-align:left">&nbsp;public void RunStarted(object automationObject, Dictionary&lt;string, string&gt; replacementsDictionary, WizardRunKind runKind, object[] customParams)</span><br style="color:#333333; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; margin-bottom:0px; padding-bottom:0px; font-size:13px; line-height:16px; text-align:left">&nbsp; &nbsp; &nbsp; &nbsp; {</span><br style="color:#333333; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; margin-bottom:0px; padding-bottom:0px; font-size:13px; line-height:16px; text-align:left">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try</span><br style="color:#333333; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; margin-bottom:0px; padding-bottom:0px; font-size:13px; line-height:16px; text-align:left">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</span><br style="color:#333333; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; margin-bottom:0px; padding-bottom:0px; font-size:13px; line-height:16px; text-align:left">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br style="color:#333333; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; margin-bottom:0px; padding-bottom:0px; font-size:13px; line-height:16px; text-align:left">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dte = automationObject as DTE; &nbsp; &nbsp; &nbsp; &nbsp;</span></p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> .............................................................................................................</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> &nbsp; replacementsDictionary.Add(&quot;&#36;ProductA&#36;&quot;, &quot;Mobile&quot;);</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> .................................................................</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> }</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> catch()</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> {</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> }</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> }</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> </p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> in Template .cshtml file please check the code.</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> &lt;html&gt;</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> </p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> </p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> &lt;head&gt; &lt;/head&gt;</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> &lt;body&gt;</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> &quot;&#36;ProductA&#36;&quot;</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> &lt;/body&gt;</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> &lt;/html&gt;</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> but the &nbsp;the value of &quot;&#36;ProductA&#36;&quot; is not replaced in .cshtml page. but it was working fine in .Aspx page .CS page. how can do that in .cshtml.</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> urgent requirement.</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> Please anyone help.</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> </p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> </p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> Thanks..</p> 2012-04-16T09:27:34-04:004934278http://forums.asp.net/p/1793282/4934278.aspx/1?Re+How+to+pass+string+from+IWizrad+run+started+method+to+razor+mvc+project+template+cshtml+file+Re: How to pass string from IWizrad run started method to razor mvc project template (.cshtml file) &lt;div class=&quot;body&quot;&gt; <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-style:inherit; font-family:inherit; margin-bottom:0px; padding-bottom:0px">i have already using this kind of coding</span></p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-style:inherit; font-family:inherit; margin-bottom:0px; padding-bottom:0px">&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;</span></p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> </p> <span style="color:#333333; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> &nbsp;public class Wizardclass : IWizard<br> &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; #region private members<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private MainWindow wizardFrm;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string customMessage;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string sXmlPath = @&quot;Products.xml&quot;;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string[] products;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string configPath;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private IEnumerable&lt;string&gt; pSelect;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private DTE dte;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string masterPath;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string textTransformLocation = string.Empty;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string sAspRazor;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string uDoc;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string destfile;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string srcMaster;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; private string destMasterFile;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; #endregion<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; public void BeforeOpeningFile(ProjectItem projectItem)<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; public void ProjectFinishedGenerating(Project project)<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; customMessage = wizardFrm.get_CustomMessage();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uDoc = Environment.GetFolderPath(Environment.SpecialFolder.Personal);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (customMessage != string.Empty &amp;&amp; !customMessage.Equals(&quot;CloseApp&quot;))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ProjectItem pConfigItem = project.ProjectItems.Item(9);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ProjectItem pMasterItem = dte.Solution.FindProjectItem(sAspRazor);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;configPath = pConfigItem.Properties.Item(&quot;FullPath&quot;).Value;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;masterPath = pMasterItem.Properties.Item(&quot;FullPath&quot;).Value; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pSelect.Contains(&quot;True&quot;))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(&quot;Common-Mobile&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pSelect.Contains(&quot;False&quot;))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(&quot;Common&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach (string product in products)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (product != string.Empty)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch (product)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Tools&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Grid&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Chart&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Gauge&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Schedule&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Diagram&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;DocIO&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Pdf&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;XlsIO&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;PdfViewer&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;OlapGrid&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Mobile-Chart&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Mobile-Grid&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Mobile-Tools&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &quot;Mobile-Gauge&quot;:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddAssembly(product);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (sAspRazor.Equals(&quot;Site.tt&quot;))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destfile = uDoc &#43; @&quot;\Site.tt&quot;;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; srcMaster = uDoc &#43; @&quot;\Site.Master&quot;;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destfile = uDoc &#43; @&quot;\_Layout.tt&quot;;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; srcMaster = uDoc &#43; @&quot;\_Layout.cshtml&quot;;<br> <br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@&quot;SOFTWARE\Microsoft\Windows\CurrentVersion&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((regKey != null))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textTransformLocation = (string)regKey.GetValue(&quot;CommonFilesDir&quot;) &#43; @&quot;\Microsoft Shared\TextTemplating\10.0\TextTransform.exe&quot;;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File.Copy(masterPath, destfile, true);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.Diagnostics.Process proc = new System.Diagnostics.Process();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc.StartInfo.UseShellExecute = true;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc.EnableRaisingEvents = false;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set text transform program (this could change according to the Windows version)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc.StartInfo.FileName = textTransformLocation;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Specify T4 template file<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc.StartInfo.Arguments = destfile;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc.Start();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc.WaitForExit();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destMasterFile =sAspRazor.Equals(&quot;Site.tt&quot;) ? masterPath.Replace(&quot;Site.tt&quot;, &quot;Site.Master&quot;) : masterPath.Replace(&quot;_Layout.tt&quot;, &quot;_Layout.cshtml&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File.Copy(srcMaster, destMasterFile,true);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; project.ProjectItems.AddFromFile(destMasterFile);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pMasterItem.Remove();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File.Delete(pMasterItem.Properties.Item(&quot;FullPath&quot;).Value);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File.Delete(destfile);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File.Delete(srcMaster);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> <br> <br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; private void AddAssembly(string prod)<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Project project = dte.Solution.Projects.Item(1);<br> <br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VSProject vsproject = project.Object;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IEnumerable&lt;XElement&gt; elementref;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Assembly ass = Assembly.GetExecutingAssembly();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement xElement = XElement.Load(sXmlPath);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IEnumerable&lt;XElement&gt; address = from el in xElement.Elements(&quot;Product&quot;) where (string)el.Attribute(&quot;name&quot;) == prod select el;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement element = address.First();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement elementAssembly = element.Element(&quot;assemblies&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement elementNameSpace = element.Element(&quot;namespaces&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement elementhttpHandler = element.Element(&quot;httpHandlers&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement elementHandler = element.Element(&quot;handlers&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (element.Element(&quot;References&quot;) != null)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elementref = element.Element(&quot;References&quot;).Elements();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach (XElement e1 in elementref)<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vsproject.References.Add(e1.Value);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement xconfigElement = XElement.Load(configPath);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement xmlAssembly = xconfigElement.Element(&quot;system.web&quot;).Element(&quot;compilation&quot;).Element(&quot;assemblies&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement xmlNamespace = xconfigElement.Element(&quot;system.web&quot;).Element(&quot;pages&quot;).Element(&quot;namespaces&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement xmlHandlers = xconfigElement.Element(&quot;system.web&quot;).Element(&quot;httpHandlers&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XElement xmlserverHandlers = xconfigElement.Element(&quot;system.webServer&quot;).Element(&quot;handlers&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Addhandlers(xmlAssembly, elementAssembly, &quot;assembly&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Addhandlers(xmlNamespace, elementNameSpace, &quot;namespace&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Addhandlers(xmlHandlers, elementhttpHandler, &quot;type&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Addhandlers(xmlserverHandlers, elementHandler, &quot;type&quot;); &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xconfigElement.Save(configPath);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; private void Addhandlers(XElement destElement, XElement srcElement, string attr)<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (srcElement != null)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; srcElement.Elements().ToList().ForEach(x =&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (destElement != null &amp;&amp; destElement.Elements() != null)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool isExist = false;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destElement.Elements().ToList().ForEach(p =&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (p != null &amp;&amp; p.Attribute(attr) != null &amp;&amp; x != null &amp;&amp; x.Attribute(attr) != null &amp;&amp; p.Attribute(attr).Value == x.Attribute(attr).Value)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isExist = true;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!isExist)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destElement.AddFirst(x);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; public void ProjectItemFinishedGenerating(ProjectItem projectItem)<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; public void RunFinished()<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; public void RunStarted(object automationObject, Dictionary&lt;string, string&gt; replacementsDictionary, WizardRunKind runKind, object[] customParams)<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dte = automationObject as DTE; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Call win form created in the project to accept user input<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wizardFrm = new MainWindow();<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wizardFrm.ShowDialog();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; customMessage = wizardFrm.get_CustomMessage();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(customMessage != string.Empty &amp;&amp; customMessage.Equals(&quot;CloseApp&quot;))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.wizardFrm.Close();<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Application.Current.MainWindow.Close(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;products = customMessage.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pSelect = products.Select(p =&gt; p.StartsWith(&quot;Mobile&quot;).ToString());<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string sScriptCombine = Convert.ToString(wizardFrm.get_CompressScript()).ToLower();<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string sStyleCombine = Convert.ToString(wizardFrm.get_CompressStyle()).ToLower();<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string DeskTheme = wizardFrm.get_DeskTheme();<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string MobTheme = wizardFrm.get_MobileTheme();<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeskTheme = string.IsNullOrEmpty(DeskTheme) ? &quot;None&quot; : DeskTheme;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MobTheme = string.IsNullOrEmpty(MobTheme) ? &quot;None&quot; : MobTheme;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(&quot;RunStart&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//customParams[customParams.Length-1] = &quot;&#36;Product&#36;=Syncfusion&quot;;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(customParams.Length.ToString());<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(customParams.FirstOrDefault().ToString());<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(customParams.LastOrDefault().ToString());<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (pSelect.Contains(&quot;True&quot;))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;ProductA&#36;&quot;, &quot;Mobile&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;MobTheme&#36;&quot;, MobTheme);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;sMobStyleCombine&#36;&quot;, sStyleCombine);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;sMobScriptCombine&#36;&quot;, sScriptCombine);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;ProductA&#36;&quot;, &quot;&quot;);<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (pSelect.Contains(&quot;False&quot;))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;ProductB&#36;&quot;, &quot;Desktop&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;DeskTheme&#36;&quot;, DeskTheme);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;sDeskStyleCombine&#36;&quot;, sStyleCombine);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;sDeskScriptCombine&#36;&quot;, sScriptCombine);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replacementsDictionary.Add(&quot;&#36;ProductB&#36;&quot;, &quot;&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch (Exception ex)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox.Show(ex.ToString());<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> <br> &nbsp; &nbsp; &nbsp;public bool ShouldAddProjectItem(string filePath)<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; customMessage = wizardFrm.get_CustomMessage();<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((filePath.Equals(&quot;Site.tt&quot;) || filePath.Equals(&quot;_Layout.tt&quot;)))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sAspRazor = filePath;<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (customMessage != string.Empty &amp;&amp; !customMessage.Equals(&quot;CloseApp&quot;))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> <br> &nbsp; &nbsp; }</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-style:inherit; font-family:inherit; margin-bottom:0px; padding-bottom:0px">From above coding i want to replace &#36;ProductA&#36; string &nbsp;Index.cshtml page to &quot;Mobile&quot;</span></p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> </p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-style:inherit; font-family:inherit; margin-bottom:0px; padding-bottom:0px">how to replace the string .cshtml page using wizard concept.</span></p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> <span style="border-width:0px; font-style:inherit; font-family:inherit; margin-bottom:0px; padding-bottom:0px">Thanks,</span></p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; border-right-style:none; border-bottom-style:none; border-left-style:none; list-style-type:none; color:#333333; font-size:13px; line-height:16px; text-align:left"> </p> &lt;/div&gt; 2012-04-16T09:27:58-04:004935705http://forums.asp.net/p/1793282/4935705.aspx/1?Re+How+to+pass+string+from+IWizrad+run+started+method+to+razor+mvc+project+template+cshtml+file+Re: How to pass string from IWizrad run started method to razor mvc project template (.cshtml file) <p>remove the</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>vigneshtr11</h4> <p></p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> catch()</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> {</p> <p style="font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; padding-right:0px; color:#333333; font-size:13px; line-height:16px; text-align:left; border-right-style:none; border-bottom-style:none; border-left-style:none"> }</p> <p></p> </blockquote> <p></p> <p></p> 2012-04-17T03:45:40-04:00