<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: NHaml News</title>
	<atom:link href="http://andrewpeters.net/2008/07/29/nhaml-news/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewpeters.net/2008/07/29/nhaml-news/</link>
	<description>C# &#38; .NET Development, NHaml, PowerShell Gadget, Inflector.NET...</description>
	<pubDate>Fri, 21 Nov 2008 10:40:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Peter</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1124</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Fri, 15 Aug 2008 14:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1124</guid>
		<description>Hi Andrew,

One more question -- in the original MVC the FooController  would check the Views/Foo folder and then check the Views/Shared folder if it could not find a proper view. It appears that you've removed this behaviour to take advantage of Layouts? Is there any way to accomplish the default MVC behaviour as I share the same view across many controllers.

If I have a view called PortfolioIndex.haml in the Shared folder, MVC can't find it (File not found exception for Views\Portfolio\PortfolioIndex.haml)

Peter</description>
		<content:encoded><![CDATA[<p>Hi Andrew,</p>
<p>One more question &#8212; in the original MVC the FooController  would check the Views/Foo folder and then check the Views/Shared folder if it could not find a proper view. It appears that you&#8217;ve removed this behaviour to take advantage of Layouts? Is there any way to accomplish the default MVC behaviour as I share the same view across many controllers.</p>
<p>If I have a view called PortfolioIndex.haml in the Shared folder, MVC can&#8217;t find it (File not found exception for Views\Portfolio\PortfolioIndex.haml)</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1122</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Fri, 15 Aug 2008 13:08:29 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1122</guid>
		<description>Hey Andrew,

That did it. Many thanks for the quick helpful response and of course NHaml itself.

Peter</description>
		<content:encoded><![CDATA[<p>Hey Andrew,</p>
<p>That did it. Many thanks for the quick helpful response and of course NHaml itself.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1118</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Fri, 15 Aug 2008 04:08:11 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1118</guid>
		<description>OK cheers. It looks like it's because NHaml uses the Extension Method hack and the VB compiler doesn't grok the duplicate definition. I'll remove the use of extension methods as they aren't essential in the core. As a workaround, you can remove NHaml's definition of ExtensionAttribute and re-target NHaml to 3.5.

Cheers,

Andrew.</description>
		<content:encoded><![CDATA[<p>OK cheers. It looks like it&#8217;s because NHaml uses the Extension Method hack and the VB compiler doesn&#8217;t grok the duplicate definition. I&#8217;ll remove the use of extension methods as they aren&#8217;t essential in the core. As a workaround, you can remove NHaml&#8217;s definition of ExtensionAttribute and re-target NHaml to 3.5.</p>
<p>Cheers,</p>
<p>Andrew.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1117</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Fri, 15 Aug 2008 03:39:57 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1117</guid>
		<description>In the IDE nothing.
If I run the compile statement in a command window I get the following:


Microsoft (R) Visual Basic Compiler version 9.0.30428.1
Copyright (c) Microsoft Corporation.  All rights reserved.

InternalXmlHelper.vb(9) : error BC30560: 'ExtensionAttribute' is ambiguous in th
e namespace 'System.Runtime.CompilerServices'.

         _
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InternalXmlHelper.vb(24) : error BC30560: 'ExtensionAttribute' is ambiguous in t
he namespace 'System.Runtime.CompilerServices'.

         _
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InternalXmlHelper.vb(39) : error BC30560: 'ExtensionAttribute' is ambiguous in t
he namespace 'System.Runtime.CompilerServices'.

         _
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm using VS2008 with MVC Preview 4. My model uses Nhibernate.</description>
		<content:encoded><![CDATA[<p>In the IDE nothing.<br />
If I run the compile statement in a command window I get the following:</p>
<p>Microsoft (R) Visual Basic Compiler version 9.0.30428.1<br />
Copyright (c) Microsoft Corporation.  All rights reserved.</p>
<p>InternalXmlHelper.vb(9) : error BC30560: &#8216;ExtensionAttribute&#8217; is ambiguous in th<br />
e namespace &#8216;System.Runtime.CompilerServices&#8217;.</p>
<p>         _<br />
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
InternalXmlHelper.vb(24) : error BC30560: &#8216;ExtensionAttribute&#8217; is ambiguous in t<br />
he namespace &#8216;System.Runtime.CompilerServices&#8217;.</p>
<p>         _<br />
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
InternalXmlHelper.vb(39) : error BC30560: &#8216;ExtensionAttribute&#8217; is ambiguous in t<br />
he namespace &#8216;System.Runtime.CompilerServices&#8217;.</p>
<p>         _<br />
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p>
<p>I&#8217;m using VS2008 with MVC Preview 4. My model uses Nhibernate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1116</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Fri, 15 Aug 2008 00:58:24 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1116</guid>
		<description>Peter,

Yep, that should be it. What does your Output window say?

Cheers,

Andrew.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Yep, that should be it. What does your Output window say?</p>
<p>Cheers,</p>
<p>Andrew.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1115</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Thu, 14 Aug 2008 23:57:29 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1115</guid>
		<description>Yes I pulled the latest code via subversion. The sample MVC project compiles and my MVC project is set up but refuses to build (without displaying any reason for not doing so). I just wanted to make sure that those two steps were all that was required to get NHaml working?</description>
		<content:encoded><![CDATA[<p>Yes I pulled the latest code via subversion. The sample MVC project compiles and my MVC project is set up but refuses to build (without displaying any reason for not doing so). I just wanted to make sure that those two steps were all that was required to get NHaml working?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1110</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Thu, 14 Aug 2008 21:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1110</guid>
		<description>Peter,

Did you pull the latest source from Google Code? In there is a sample MVC project you can use as a starting point.

Cheers,

Andrew.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Did you pull the latest source from Google Code? In there is a sample MVC project you can use as a starting point.</p>
<p>Cheers,</p>
<p>Andrew.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1109</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Thu, 14 Aug 2008 19:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1109</guid>
		<description>Hi Andrew,

I downloaded your source, took out the NHaml.dll and NHaml.Web.Mvc.dll and referenced them in my MVC Preview 4 project. I also added the 

ControllerBuilder.Current.SetControllerFactory(new NHaml.Web.Mvc.NHamlControllerFactory());

line to my Global.asax file. My app won't build now (although it did before and does if I remove the references to the two DLLs). Did I miss something in the configuration process (web.config modifications maybe)? 

Great working! Look forward to</description>
		<content:encoded><![CDATA[<p>Hi Andrew,</p>
<p>I downloaded your source, took out the NHaml.dll and NHaml.Web.Mvc.dll and referenced them in my MVC Preview 4 project. I also added the </p>
<p>ControllerBuilder.Current.SetControllerFactory(new NHaml.Web.Mvc.NHamlControllerFactory());</p>
<p>line to my Global.asax file. My app won&#8217;t build now (although it did before and does if I remove the references to the two DLLs). Did I miss something in the configuration process (web.config modifications maybe)? </p>
<p>Great working! Look forward to</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1102</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 13 Aug 2008 21:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1102</guid>
		<description>Hi Igor,

Add a method such as this to your base class:

public void Render(TextWriter outputWriter, int timing)
{
  Timing = timing;

  ((ICompiledTemplate)this).Render(outputWriter);
}

Hope this helps,

Andrew.</description>
		<content:encoded><![CDATA[<p>Hi Igor,</p>
<p>Add a method such as this to your base class:</p>
<p>public void Render(TextWriter outputWriter, int timing)<br />
{<br />
  Timing = timing;</p>
<p>  ((ICompiledTemplate)this).Render(outputWriter);<br />
}</p>
<p>Hope this helps,</p>
<p>Andrew.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Igor Loginov</title>
		<link>http://andrewpeters.net/2008/07/29/nhaml-news/#comment-1101</link>
		<dc:creator>Igor Loginov</dc:creator>
		<pubDate>Wed, 13 Aug 2008 16:45:55 +0000</pubDate>
		<guid isPermaLink="false">http://andrewpeters.net/?p=105#comment-1101</guid>
		<description>Andrew,

Latest releases tell that you are hardly working on NHaml performance now. Thank you!

Let me ask you a question regarding recent changes in NHaml core. I try using NHaml in scenarios much more simple than ASP.NET MVC. So, let's imagine I want to build a web page and dynamically insert a phrase "It took %d seconds to prepare data for this page" somewhere on it. WHat I did with NHaml 1.0 ? I created data class TestNHamlData with Timing property. Then I used the lines

templateCompiler.ViewBaseType = typeof(TestNHamlData);
Type viewType = templateCompiler.Compile(template, layout);
ICompiledView view = (ICompiledView)Activator.CreateInstance(viewType);

After some digging in code I knew that NHaml generates a class inherited from my TestNHamlData and implementing ICompiledView interface. Thus, view is an object of this class, and the following will work:

TestNHamlData viewData = view as TestNHamlData;  // thank to TestNHamlData inheritance
viewData.Timing = elapsedTime;
output = view.Render(); // thank to ICompiledView interface

... and I am happy with up-to-date data in generated output.

What is in new version? Instead of Activator there is TemplateActivator which is generic delegate for calling a dynamic method with Reflection.Emit inside. Much faster way of generation! But how to set my last-minute-data to generated object before rendering if ViewType with both base class and ICompiledView interface is not available anymore?

I will greatly appreciate your comments.</description>
		<content:encoded><![CDATA[<p>Andrew,</p>
<p>Latest releases tell that you are hardly working on NHaml performance now. Thank you!</p>
<p>Let me ask you a question regarding recent changes in NHaml core. I try using NHaml in scenarios much more simple than ASP.NET MVC. So, let&#8217;s imagine I want to build a web page and dynamically insert a phrase &#8220;It took %d seconds to prepare data for this page&#8221; somewhere on it. WHat I did with NHaml 1.0 ? I created data class TestNHamlData with Timing property. Then I used the lines</p>
<p>templateCompiler.ViewBaseType = typeof(TestNHamlData);<br />
Type viewType = templateCompiler.Compile(template, layout);<br />
ICompiledView view = (ICompiledView)Activator.CreateInstance(viewType);</p>
<p>After some digging in code I knew that NHaml generates a class inherited from my TestNHamlData and implementing ICompiledView interface. Thus, view is an object of this class, and the following will work:</p>
<p>TestNHamlData viewData = view as TestNHamlData;  // thank to TestNHamlData inheritance<br />
viewData.Timing = elapsedTime;<br />
output = view.Render(); // thank to ICompiledView interface</p>
<p>&#8230; and I am happy with up-to-date data in generated output.</p>
<p>What is in new version? Instead of Activator there is TemplateActivator which is generic delegate for calling a dynamic method with Reflection.Emit inside. Much faster way of generation! But how to set my last-minute-data to generated object before rendering if ViewType with both base class and ICompiledView interface is not available anymore?</p>
<p>I will greatly appreciate your comments.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
