<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/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>Static method reflection</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx</link><description>.NET reflection features are powerful and this is really what makes it a powerful platform. We don't use reflection everyday, but when we do it's really useful. Don't you hate it though when you have to write code like this?: MethodInfo method = typeof</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Static method reflection</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx#456049</link><pubDate>Mon, 10 Jul 2006 02:46:44 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:456049</guid><dc:creator>Marc Brooks</dc:creator><author>Marc Brooks</author><description>&lt;p&gt;You can do it now, without the lambda stuff, though it is nicer when you can use &amp;quot;var&amp;quot;. &amp;nbsp;I&amp;#39;ve got a generic method invoker built that is strong typed (or weak typed if desired), works with static and instance methods and builds a LCG stub that does minor type coercision (if needed) and boxing/unboxing. &amp;nbsp;Check it out at &lt;a rel="nofollow" href="http://musingmarc.blogspot.com/2006/07/power-of-generics-compells-you-power.html" target="_new"&gt;http://musingmarc.blogspot.com/2006/07/power-of-generics-compels-you-power-of.html&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=456049" width="1" height="1"&gt;</description></item><item><title>re: Static method reflection</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx#455732</link><pubDate>Thu, 06 Jul 2006 17:38:47 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:455732</guid><dc:creator>Fabrice Marguerie</dc:creator><author>Fabrice Marguerie</author><description>&lt;p&gt;Exactly, now we have support for static and instance methods, as well as for properties.&lt;/p&gt;
&lt;p&gt;The next challenge is to find a solution for parameters so that we don't have to write the following, which contains a hard-coded string:&lt;/p&gt;
&lt;p&gt;if (param1 == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;throw new ArgumentNullException(&amp;quot;param1&amp;quot;);&lt;/p&gt;
&lt;p&gt;Eveything seems possible now with lambda expressions :)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=455732" width="1" height="1"&gt;</description></item><item><title>re: Static method reflection</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx#455731</link><pubDate>Thu, 06 Jul 2006 17:10:08 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:455731</guid><dc:creator>Daniel Cazzulino</dc:creator><author>Daniel Cazzulino</author><description>&lt;p&gt;Wow... that's cool... I can complement it with mine (which doesn't work on non-static members) and have the best of all worlds!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=455731" width="1" height="1"&gt;</description></item><item><title>Strongly-typed reflection redux</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx#455727</link><pubDate>Thu, 06 Jul 2006 15:36:22 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:455727</guid><dc:creator>Fabrice's weblog</dc:creator><author>Fabrice's weblog</author><description>&lt;p&gt;As a followup to my last post, you can read Daniel Cazzulino's post in which he presents a solution for&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=455727" width="1" height="1"&gt;</description></item><item><title>re: Static method reflection</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx#455637</link><pubDate>Wed, 05 Jul 2006 21:55:10 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:455637</guid><dc:creator>Fabrice Marguerie</dc:creator><author>Fabrice Marguerie</author><description>&lt;p&gt;Of course, this is not a problem if you call GetMethod from a method of the instance itself, as Ayende pointed out to me.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=455637" width="1" height="1"&gt;</description></item><item><title>Interesting Finds: July 5, 2006</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx#455587</link><pubDate>Wed, 05 Jul 2006 13:46:24 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:455587</guid><dc:creator>Jason Haley</dc:creator><author>Jason Haley</author><description>&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=455587" width="1" height="1"&gt;</description></item><item><title>re: Static method reflection</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx#455583</link><pubDate>Wed, 05 Jul 2006 13:11:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:455583</guid><dc:creator>Fabrice Marguerie</dc:creator><author>Fabrice Marguerie</author><description>&lt;p&gt;That's true, but it requires an object instance like this: GetMethod&amp;lt;int, string&amp;gt;(new MyClass().MyInstanceMethod), while you don't need an instance with typeof(MyClass).GetMethod(&amp;quot;MyInstanceMethod&amp;quot;);&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=455583" width="1" height="1"&gt;</description></item><item><title>re: Static method reflection</title><link>http://weblogs.asp.net/fmarguerie/archive/2006/07/05/Static-method-reflection.aspx#455580</link><pubDate>Wed, 05 Jul 2006 11:06:42 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:455580</guid><dc:creator>Ayende Rahien</dc:creator><author>Ayende Rahien</author><description>&lt;p&gt;Just to comment, it works on instance methods as well.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=455580" width="1" height="1"&gt;</description></item></channel></rss>