<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: More C# Attribute annoyances</title>
	<atom:link href="http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Wed, 22 May 2013 13:39:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: [WTF] Generic attributes in C# &#124; mnaoumov.NET</title>
		<link>http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/#comment-5083</link>
		<dc:creator>[WTF] Generic attributes in C# &#124; mnaoumov.NET</dc:creator>
		<pubDate>Mon, 24 Sep 2012 03:45:30 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/12/11/more-c-attribute-annoyances.aspx#comment-5083</guid>
		<description>[...] Another annoyances Share this:EmailPrint Pin ItShare on TumblrDiggLike this:LikeBe the first to like this. [...]</description>
		<content:encoded><![CDATA[<p>[...] Another annoyances Share this:EmailPrint Pin ItShare on TumblrDiggLike this:LikeBe the first to like this. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/#comment-1078</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 15 Sep 2010 21:35:07 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/12/11/more-c-attribute-annoyances.aspx#comment-1078</guid>
		<description>It might be worth reading this article about dynamic attributes in c:
http://geekswithblogs.net/abhijeetp/archive/2009/01/10/dynamic-attributes-in-c.aspx</description>
		<content:encoded><![CDATA[<p>It might be worth reading this article about dynamic attributes in c:<br />
<a href="http://geekswithblogs.net/abhijeetp/archive/2009/01/10/dynamic-attributes-in-c.aspx" rel="nofollow">http://geekswithblogs.net/abhijeetp/archive/2009/01/10/dynamic-attributes-in-c.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien</title>
		<link>http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/#comment-1077</link>
		<dc:creator>Damien</dc:creator>
		<pubDate>Mon, 12 Oct 2009 23:23:26 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/12/11/more-c-attribute-annoyances.aspx#comment-1077</guid>
		<description>&gt; passing a delegate would be fantastic eh!

Totally. 

Best way I&#039;ve found to get around this is pass in an array of enums, each mapped to an anonymous function. </description>
		<content:encoded><![CDATA[<p>> passing a delegate would be fantastic eh!</p>
<p>Totally. </p>
<p>Best way I&#8217;ve found to get around this is pass in an array of enums, each mapped to an anonymous function. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Mosafi</title>
		<link>http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/#comment-1076</link>
		<dc:creator>Neil Mosafi</dc:creator>
		<pubDate>Tue, 30 Dec 2008 16:24:23 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/12/11/more-c-attribute-annoyances.aspx#comment-1076</guid>
		<description>Feeling your pain the Action one - passing a delegate would be fantastic eh!</description>
		<content:encoded><![CDATA[<p>Feeling your pain the Action one &#8211; passing a delegate would be fantastic eh!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Houston</title>
		<link>http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/#comment-1075</link>
		<dc:creator>Ray Houston</dc:creator>
		<pubDate>Sun, 14 Dec 2008 00:53:29 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/12/11/more-c-attribute-annoyances.aspx#comment-1075</guid>
		<description>@jimmy - A lot of the time we end up with an attribute that just takes a Type and we do all the crazy stuff outside the scope of the attribute.

[ValueConverter(typeof(EnumValueConverter&lt;FormSubType&gt;))]
public FormSubType FormSubType { get; set; }

The code that uses the attribute can ask it to create an instance of that type. At that point we check if it&#039;s the right type and create and instance of it and return it. The disadvantage is that we don&#039;t get compile time checking for the type but that really hasn&#039;t been a problem.
</description>
		<content:encoded><![CDATA[<p>@jimmy &#8211; A lot of the time we end up with an attribute that just takes a Type and we do all the crazy stuff outside the scope of the attribute.</p>
<p>[ValueConverter(typeof(EnumValueConverter<br />
<formsubtype>))]<br />
public FormSubType FormSubType { get; set; }</p>
<p>The code that uses the attribute can ask it to create an instance of that type. At that point we check if it&#8217;s the right type and create and instance of it and return it. The disadvantage is that we don&#8217;t get compile time checking for the type but that really hasn&#8217;t been a problem.<br />
</formsubtype>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/#comment-1074</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Fri, 12 Dec 2008 12:43:43 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/12/11/more-c-attribute-annoyances.aspx#comment-1074</guid>
		<description>@Paul

We do have some insight into *when* an attribute is instantiated - it&#039;s when you query type/member info for its custom attributes.  Maybe it&#039;s from the fact that you can&#039;t guarantee immutability after compilation for anything but a few special cases.</description>
		<content:encoded><![CDATA[<p>@Paul</p>
<p>We do have some insight into *when* an attribute is instantiated &#8211; it&#8217;s when you query type/member info for its custom attributes.  Maybe it&#8217;s from the fact that you can&#8217;t guarantee immutability after compilation for anything but a few special cases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Batum</title>
		<link>http://lostechies.com/jimmybogard/2008/12/12/more-c-attribute-annoyances/#comment-1073</link>
		<dc:creator>Paul Batum</dc:creator>
		<pubDate>Fri, 12 Dec 2008 02:40:42 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/12/11/more-c-attribute-annoyances.aspx#comment-1073</guid>
		<description>I agree with most of your complaints, but it makes sense to me that attribute arguments must be constants. Attribute instantiation is completely transparent - if an attribute is initialized from a mutable field, how can I reason effectively about what its value will be?</description>
		<content:encoded><![CDATA[<p>I agree with most of your complaints, but it makes sense to me that attribute arguments must be constants. Attribute instantiation is completely transparent &#8211; if an attribute is initialized from a mutable field, how can I reason effectively about what its value will be?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
