<?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: Extension Methods in Vb.Net and C#</title>
	<atom:link href="http://blog.gadodia.net/extension-methods-in-vbnet-and-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/</link>
	<description>"... tech .... fun .. bizarre ... india .... pictures ..... anything in the world ...."</description>
	<lastBuildDate>Sat, 28 Jan 2012 14:48:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: What are the best practices for using Extension Methods in .Net? &#171; &#171; Programmers Goodies Programmers Goodies</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-17116</link>
		<dc:creator>What are the best practices for using Extension Methods in .Net? &#171; &#171; Programmers Goodies Programmers Goodies</dc:creator>
		<pubDate>Sun, 03 Jul 2011 10:15:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-17116</guid>
		<description>[...] I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a point). [...]</description>
		<content:encoded><![CDATA[<p>[...] I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a point). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pimsainnum</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-17065</link>
		<dc:creator>pimsainnum</dc:creator>
		<pubDate>Tue, 31 May 2011 09:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-17065</guid>
		<description>Thank you for share.

G rest blog.
I try to solve my code found error about enum.
When pass parameter to method.???</description>
		<content:encoded><![CDATA[<p>Thank you for share.</p>
<p>G rest blog.<br />
I try to solve my code found error about enum.<br />
When pass parameter to method.???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Was sind die best Practices für die Verwendung von Erweiterungsmethoden in .net? &#124; tutupk</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-16924</link>
		<dc:creator>Was sind die best Practices für die Verwendung von Erweiterungsmethoden in .net? &#124; tutupk</dc:creator>
		<pubDate>Fri, 01 Apr 2011 14:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-16924</guid>
		<description>[...] wird, und haben mit ihnen der falsche Weg (obwohl in diesem Fall ich ihnen auf diese Weise eine zeigen Siedemonstrieren verwendet wurde) beschuldigt [...]</description>
		<content:encoded><![CDATA[<p>[...] wird, und haben mit ihnen der falsche Weg (obwohl in diesem Fall ich ihnen auf diese Weise eine zeigen Siedemonstrieren verwendet wurde) beschuldigt [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaibhav</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-16862</link>
		<dc:creator>Vaibhav</dc:creator>
		<pubDate>Fri, 04 Mar 2011 15:58:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-16862</guid>
		<description>Yup. Am jealous.</description>
		<content:encoded><![CDATA[<p>Yup. Am jealous.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MoVBNet</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-16856</link>
		<dc:creator>MoVBNet</dc:creator>
		<pubDate>Thu, 03 Mar 2011 16:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-16856</guid>
		<description>Now the C# developers decide to take the high road about not using mutable objects?  What ever happened to less is more?  Come on admit it, you are just jealous that you can&#039;t do this. :)</description>
		<content:encoded><![CDATA[<p>Now the C# developers decide to take the high road about not using mutable objects?  What ever happened to less is more?  Come on admit it, you are just jealous that you can&#8217;t do this. <img src='http://blog.gadodia.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rj</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-13494</link>
		<dc:creator>rj</dc:creator>
		<pubDate>Wed, 11 Nov 2009 15:30:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-13494</guid>
		<description>That would be called like

MyEnum enum1;

enum1 = enum1.FromString(thestring);

IMO that&#039;s not natural at all.</description>
		<content:encoded><![CDATA[<p>That would be called like</p>
<p>MyEnum enum1;</p>
<p>enum1 = enum1.FromString(thestring);</p>
<p>IMO that&#8217;s not natural at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Dority</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-11599</link>
		<dc:creator>Daniel Dority</dc:creator>
		<pubDate>Thu, 13 Aug 2009 18:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-11599</guid>
		<description>Seriously, I saw this post and I cannot believe it was never resolved.

Here&#039;s your solution:

public static Enum FromString(this Enum theEnum, string fromString)
        {
            return (Enum)Enum.Parse(theEnum.GetType(), fromString);
        }</description>
		<content:encoded><![CDATA[<p>Seriously, I saw this post and I cannot believe it was never resolved.</p>
<p>Here&#8217;s your solution:</p>
<p>public static Enum FromString(this Enum theEnum, string fromString)<br />
        {<br />
            return (Enum)Enum.Parse(theEnum.GetType(), fromString);<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wizdumb</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-10789</link>
		<dc:creator>Wizdumb</dc:creator>
		<pubDate>Tue, 07 Apr 2009 16:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-10789</guid>
		<description>Look Cosmo and others.  You miss the point!
Please read the thread before attempting to be &quot;smart&quot;.

Do like Oboma - &quot;When I open my mouth, I like to know what I&#039;m talking about.&quot;</description>
		<content:encoded><![CDATA[<p>Look Cosmo and others.  You miss the point!<br />
Please read the thread before attempting to be &#8220;smart&#8221;.</p>
<p>Do like Oboma &#8211; &#8220;When I open my mouth, I like to know what I&#8217;m talking about.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cosmo</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-10721</link>
		<dc:creator>cosmo</dc:creator>
		<pubDate>Sat, 14 Mar 2009 21:14:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-10721</guid>
		<description>I defense of the OP. I completely understand what he is trying to do.  If you had ownership of the code for System.String, you wouldn&#039;t build a method on that class to convert it to some random enum. That has nothing to do with the natural behaviour that should be encapsulated within that class. It&#039;s not the responsibility of String to know about all the enums out there. But adding an extension to the enum itself is like encapsulating that behaviour within the type (in this case an enum) itself. It&#039;s very natural. But making a string covert itself to an enum is wicked evil.</description>
		<content:encoded><![CDATA[<p>I defense of the OP. I completely understand what he is trying to do.  If you had ownership of the code for System.String, you wouldn&#8217;t build a method on that class to convert it to some random enum. That has nothing to do with the natural behaviour that should be encapsulated within that class. It&#8217;s not the responsibility of String to know about all the enums out there. But adding an extension to the enum itself is like encapsulating that behaviour within the type (in this case an enum) itself. It&#8217;s very natural. But making a string covert itself to an enum is wicked evil.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pocketmnky</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-10460</link>
		<dc:creator>Pocketmnky</dc:creator>
		<pubDate>Thu, 11 Dec 2008 04:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-10460</guid>
		<description>Well I found this site after running into the same problem.  I am using a Matrix struct that is a part of the XNA framework in c#.  I was porting over some C++ code that was using nested arrays to describe a matrix such as:

a[0][0] = Matrix.m11

Now, the Matrix struct is awesome and used in alot of places but the one thing that I can&#039;t do with it is access the rows and columns by indexer like myMatrix[0][0].  I figured I could just make an extender like Matrix.SetValueByRowAndColumn(this Matrix m, int rowindex, int colindex, float value) or something but seeing that Matrix m is passed over byVal and not byRef, you can&#039;t change any of the values!

And I NEED to write it this way, I have nested loops that run through the rows and columns of my matrix (from the ported code) that would be very sloppy if I broke them out.

So what was my simple solution?  I just changed the &quot;this&quot; into a &quot;ref&quot; and now instead of an extender, I&#039;ve got a static method that looks like:
MyNamespace.MyClass.SetValueByRowAndColumn(ref myMatrix, (int)row, (int)col, (float)val);

It&#039;s not as pretty and completely defeats the purpose, but after reading through this page and all of the comments I was ready to shove my head in the oven.  Figuring out that there was a simple fix made me ecstatic!</description>
		<content:encoded><![CDATA[<p>Well I found this site after running into the same problem.  I am using a Matrix struct that is a part of the XNA framework in c#.  I was porting over some C++ code that was using nested arrays to describe a matrix such as:</p>
<p>a[0][0] = Matrix.m11</p>
<p>Now, the Matrix struct is awesome and used in alot of places but the one thing that I can&#8217;t do with it is access the rows and columns by indexer like myMatrix[0][0].  I figured I could just make an extender like Matrix.SetValueByRowAndColumn(this Matrix m, int rowindex, int colindex, float value) or something but seeing that Matrix m is passed over byVal and not byRef, you can&#8217;t change any of the values!</p>
<p>And I NEED to write it this way, I have nested loops that run through the rows and columns of my matrix (from the ported code) that would be very sloppy if I broke them out.</p>
<p>So what was my simple solution?  I just changed the &#8220;this&#8221; into a &#8220;ref&#8221; and now instead of an extender, I&#8217;ve got a static method that looks like:<br />
MyNamespace.MyClass.SetValueByRowAndColumn(ref myMatrix, (int)row, (int)col, (float)val);</p>
<p>It&#8217;s not as pretty and completely defeats the purpose, but after reading through this page and all of the comments I was ready to shove my head in the oven.  Figuring out that there was a simple fix made me ecstatic!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaibhav</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-9867</link>
		<dc:creator>Vaibhav</dc:creator>
		<pubDate>Thu, 28 Aug 2008 21:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-9867</guid>
		<description>@Rick.. oh well, its back to the old status for me then...</description>
		<content:encoded><![CDATA[<p>@Rick.. oh well, its back to the old status for me then&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick E</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-9866</link>
		<dc:creator>Rick E</dc:creator>
		<pubDate>Thu, 28 Aug 2008 17:59:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-9866</guid>
		<description>This is an old article. I know this isn&#039;t true because I have a few extension methods off of system.object.</description>
		<content:encoded><![CDATA[<p>This is an old article. I know this isn&#8217;t true because I have a few extension methods off of system.object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaibhav</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-9865</link>
		<dc:creator>Vaibhav</dc:creator>
		<pubDate>Thu, 28 Aug 2008 17:13:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-9865</guid>
		<description>@John, I didn&#039;t realize that... thanks for pointing that out though... of course, I was being a bit melodramatic back there, but it does make it a little better :D</description>
		<content:encoded><![CDATA[<p>@John, I didn&#8217;t realize that&#8230; thanks for pointing that out though&#8230; of course, I was being a bit melodramatic back there, but it does make it a little better <img src='http://blog.gadodia.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Moreno</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-9864</link>
		<dc:creator>John Moreno</dc:creator>
		<pubDate>Thu, 28 Aug 2008 16:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-9864</guid>
		<description>If it makes you feel any better, there&#039;s something you can do in C# that you can&#039;t do in VB: create an extension method that works on System.Object.

See this blog from the VBTeam:
http://blogs.msdn.com/vbteam/archive/2007/01/24/extension-methods-and-late-binding-extension-methods-part-4.aspx</description>
		<content:encoded><![CDATA[<p>If it makes you feel any better, there&#8217;s something you can do in C# that you can&#8217;t do in VB: create an extension method that works on System.Object.</p>
<p>See this blog from the VBTeam:<br />
<a href="http://blogs.msdn.com/vbteam/archive/2007/01/24/extension-methods-and-late-binding-extension-methods-part-4.aspx" rel="nofollow">http://blogs.msdn.com/vbteam/archive/2007/01/24/extension-methods-and-late-binding-extension-methods-part-4.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaibhav</title>
		<link>http://blog.gadodia.net/extension-methods-in-vbnet-and-c/comment-page-1/#comment-9446</link>
		<dc:creator>Vaibhav</dc:creator>
		<pubDate>Wed, 23 Jul 2008 15:30:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gadodia.net/extension-methods-in-vbnet-and-c/#comment-9446</guid>
		<description>I am glad that you see it the same way Rick (the first part).

I always liked Maths better than literature in High School, so I guess that&#039;s why I like C# better :)

Thanks for all your comments.</description>
		<content:encoded><![CDATA[<p>I am glad that you see it the same way Rick (the first part).</p>
<p>I always liked Maths better than literature in High School, so I guess that&#8217;s why I like C# better <img src='http://blog.gadodia.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks for all your comments.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

