<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Generic delegate in C# 3.0 or .NET 3.5</title><link>http://blogs.msdn.com/zainala/archive/2008/11/15/generic-delegate-in-c-3-0-or-net-3-5.aspx</link><description>As we do event-based programming or implement publish-subscribe pattern, we use the delegate feature from .NET heavily. The sample code below demonstrates simple usage of the feature. public delegate void DataChangedDelegate ( int oldValue, int newValue);</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Generic delegate in C# 3.0 or .NET 3.5 | Tmao Coders</title><link>http://blogs.msdn.com/zainala/archive/2008/11/15/generic-delegate-in-c-3-0-or-net-3-5.aspx#9102702</link><pubDate>Sun, 16 Nov 2008 10:46:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9102702</guid><dc:creator>Generic delegate in C# 3.0 or .NET 3.5 | Tmao Coders</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.tmao.info/generic-delegate-in-c-30-or-net-35/"&gt;http://www.tmao.info/generic-delegate-in-c-30-or-net-35/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Generic delegate in C# 3.0 or .NET 3.5</title><link>http://blogs.msdn.com/zainala/archive/2008/11/15/generic-delegate-in-c-3-0-or-net-3-5.aspx#9102716</link><pubDate>Sun, 16 Nov 2008 11:00:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9102716</guid><dc:creator>int19h</dc:creator><description>&lt;p&gt;&amp;gt; Another thing is we can't use the delegate type we created interchangeably with its counterpart generic delegates unfortunately even though they have same signature (and not with explicit conversion either).&lt;/p&gt;
&lt;p&gt;While it is true that explicit cast will not work, there is still a way to do an explicit conversion here:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;DataChangedDelegate dataChanged;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Action&amp;lt;int, int&amp;gt; genericFunc;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;dataChanged = new DataChangedDelegate(genericFunc); &lt;/p&gt;
&lt;p&gt;And, of course, while speaking about this, it is also worth mentioning some slightly more specialized generic delegate types from .NET 2.0 such as Predicate&amp;lt;T&amp;gt;.&lt;/p&gt;
</description></item><item><title>re: Generic delegate in C# 3.0 or .NET 3.5</title><link>http://blogs.msdn.com/zainala/archive/2008/11/15/generic-delegate-in-c-3-0-or-net-3-5.aspx#9106995</link><pubDate>Mon, 17 Nov 2008 08:18:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9106995</guid><dc:creator>zainala</dc:creator><description>&lt;p&gt;thanks a bunch for very useful tip, i learn new things everyday.&lt;/p&gt;
</description></item></channel></rss>