<?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: Simple equivalent of &#8220;With&#8221; statement in C#</title>
	<atom:link href="http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/feed/" rel="self" type="application/rss+xml" />
	<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/</link>
	<description>Technology, Programming, Career, Fun, Friends And Thoughts</description>
	<lastBuildDate>Thu, 15 Mar 2012 02:12:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Ken Baltrinic</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-48162</link>
		<dc:creator>Ken Baltrinic</dc:creator>
		<pubDate>Sun, 24 Jul 2011 21:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-48162</guid>
		<description>Interesting idea.  I wrote a [blog](http://blog.baltrinic.com/software-development/dotnet/c-equivalent-for-visual-basic-with-statement) some time back that took a similar approach but didn&#039;t use reflection.  I like your syntax better but people might find mine a little simpler and possible faster.</description>
		<content:encoded><![CDATA[<p>Interesting idea.  I wrote a [blog](http://blog.baltrinic.com/software-development/dotnet/c-equivalent-for-visual-basic-with-statement) some time back that took a similar approach but didn&#8217;t use reflection.  I like your syntax better but people might find mine a little simpler and possible faster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anay</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-13895</link>
		<dc:creator>Anay</dc:creator>
		<pubDate>Thu, 29 Apr 2010 13:34:43 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-13895</guid>
		<description>Hi David,

Thanks for your comment. It&#039;s nice that you liked this idea and used it to make a suggestion.</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>Thanks for your comment. It&#8217;s nice that you liked this idea and used it to make a suggestion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Blaine Fullerton</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-13798</link>
		<dc:creator>David Blaine Fullerton</dc:creator>
		<pubDate>Sat, 24 Apr 2010 11:46:22 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-13798</guid>
		<description>I really love your idea.  I submitted this as a suggestion for the next VS 2010.  I will try to give you my link, if possible.  Trust me, you&#039;ve got it right.  They need to change the LANGUAGE SYNTAX to allow this funcitonality.  Here is my suggestion, based on your work.

https://connect.microsoft.com/VisualStudio/feedback/details/553763/change-language-syntax-of-c-to-allow-with-end-feature-like-in-vb</description>
		<content:encoded><![CDATA[<p>I really love your idea.  I submitted this as a suggestion for the next VS 2010.  I will try to give you my link, if possible.  Trust me, you&#8217;ve got it right.  They need to change the LANGUAGE SYNTAX to allow this funcitonality.  Here is my suggestion, based on your work.</p>
<p><a href="https://connect.microsoft.com/VisualStudio/feedback/details/553763/change-language-syntax-of-c-to-allow-with-end-feature-like-in-vb" rel="nofollow">https://connect.microsoft.com/VisualStudio/feedback/details/553763/change-language-syntax-of-c-to-allow-with-end-feature-like-in-vb</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anay</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-13497</link>
		<dc:creator>Anay</dc:creator>
		<pubDate>Wed, 31 Mar 2010 11:19:07 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-13497</guid>
		<description>Hi Chris,

Any DSL implementation like this would mean that you won&#039;t be able to enjoy some features provided by IDE. You need to loose something to gain something right?</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>Any DSL implementation like this would mean that you won&#8217;t be able to enjoy some features provided by IDE. You need to loose something to gain something right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-11596</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 10 Nov 2009 22:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-11596</guid>
		<description>Thank you for this, I&#039;ve been looking for something like this for a while.  Very useful, however the big draw back of this method is that it lacks intellisense;

for instance I have (where this.Event is a property of type Event)
var event = this.Event;
person.Set(
   Name =&gt; &quot;SomeName&quot;;
);

this works but Name or any other attributes of the class Event don&#039;t show up, is there a way to fix/alter this so intellisense will work?

Others very useful thank you.</description>
		<content:encoded><![CDATA[<p>Thank you for this, I&#8217;ve been looking for something like this for a while.  Very useful, however the big draw back of this method is that it lacks intellisense;</p>
<p>for instance I have (where this.Event is a property of type Event)<br />
var event = this.Event;<br />
person.Set(<br />
   Name =&gt; &#8220;SomeName&#8221;;<br />
);</p>
<p>this works but Name or any other attributes of the class Event don&#8217;t show up, is there a way to fix/alter this so intellisense will work?</p>
<p>Others very useful thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris Donnan</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-11414</link>
		<dc:creator>chris Donnan</dc:creator>
		<pubDate>Tue, 27 Oct 2009 08:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-11414</guid>
		<description>In my current project we have an extension called With that we use a little differently. We are interested in using it to return the same value:

public static T With(this T t, Action action) {
     action(t);
     return t;
}

var z = new Zed(&quot;ctorArg1&quot;,2,3).With(m =&gt; m.PropX = 234);

Different, but very useful and related.</description>
		<content:encoded><![CDATA[<p>In my current project we have an extension called With that we use a little differently. We are interested in using it to return the same value:</p>
<p>public static T With(this T t, Action action) {<br />
     action(t);<br />
     return t;<br />
}</p>
<p>var z = new Zed(&#8220;ctorArg1&#8243;,2,3).With(m =&gt; m.PropX = 234);</p>
<p>Different, but very useful and related.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Visualizing Concurrency, F# and More &#171; Tales from a Trading Desk</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-11405</link>
		<dc:creator>Visualizing Concurrency, F# and More &#171; Tales from a Trading Desk</dc:creator>
		<pubDate>Mon, 26 Oct 2009 22:23:09 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-11405</guid>
		<description>[...] equivalent of “With” statement in [...]</description>
		<content:encoded><![CDATA[<p>[...] equivalent of “With” statement in [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anay</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-10236</link>
		<dc:creator>Anay</dc:creator>
		<pubDate>Wed, 12 Aug 2009 05:32:58 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-10236</guid>
		<description>Thanks a lot guys for your valuable comments. Let me clarify few points here:

1) The idea of this post is not to get this feature in mainstream development. I personally hate use of reflections while developing as they create problems while debugging the code. But in case you are working on building a DSL, then such ideas do help a lot. Overall, that depends on design decisions.

2) C# does provide feature to set values for properties while creating the instance of a particular class as mentioned in the comments. This feature allows to set property values only at the time of creating the instance. It cannot be used to change the values of multiple properties later.

I feel I should have mentioned this in the post to avoid confusion. Apologies.</description>
		<content:encoded><![CDATA[<p>Thanks a lot guys for your valuable comments. Let me clarify few points here:</p>
<p>1) The idea of this post is not to get this feature in mainstream development. I personally hate use of reflections while developing as they create problems while debugging the code. But in case you are working on building a DSL, then such ideas do help a lot. Overall, that depends on design decisions.</p>
<p>2) C# does provide feature to set values for properties while creating the instance of a particular class as mentioned in the comments. This feature allows to set property values only at the time of creating the instance. It cannot be used to change the values of multiple properties later.</p>
<p>I feel I should have mentioned this in the post to avoid confusion. Apologies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: (Stolen from proggit)</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-10235</link>
		<dc:creator>(Stolen from proggit)</dc:creator>
		<pubDate>Wed, 12 Aug 2009 04:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-10235</guid>
		<description>var person = new Person() 
{
     Name = &quot;Super Man&quot;,
     Age = 30
};
// No tricks or performance penalties...</description>
		<content:encoded><![CDATA[<p>var person = new Person()<br />
{<br />
     Name = &#8220;Super Man&#8221;,<br />
     Age = 30<br />
};<br />
// No tricks or performance penalties&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gordon</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/comment-page-1/#comment-10233</link>
		<dc:creator>Gordon</dc:creator>
		<pubDate>Wed, 12 Aug 2009 02:28:02 +0000</pubDate>
		<guid isPermaLink="false">http://anaykamat.com/?p=84#comment-10233</guid>
		<description>This is already in C#:

var person = new Person() { Name=&quot;superman&quot;, Age=30 };</description>
		<content:encoded><![CDATA[<p>This is already in C#:</p>
<p>var person = new Person() { Name=&#8221;superman&#8221;, Age=30 };</p>
]]></content:encoded>
	</item>
</channel>
</rss>

