<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>my code trip &#187; C# .Net</title>
	<atom:link href="http://mycodetrip.com/tag/csharp-c-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://mycodetrip.com</link>
	<description>stories from the information technology highway</description>
	<lastBuildDate>Thu, 01 Jul 2010 04:47:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How To Create A Dynamic Xml Reader In C# 4.0</title>
		<link>http://mycodetrip.com/2009/01/07/how-to-create-a-dynamic-xml-reader-in-c-40_227/</link>
		<comments>http://mycodetrip.com/2009/01/07/how-to-create-a-dynamic-xml-reader-in-c-40_227/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 04:53:12 +0000</pubDate>
		<dc:creator>Shiva</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[C# .Net]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=227</guid>
		<description><![CDATA[A detailed tutorial on Creating a dynamic Xml Reader In C# 4.0. Includes downloadable source code in a zip file ]]></description>
			<content:encoded><![CDATA[<p>A detailed tutorial on Creating a dynamic Xml Reader In C# 4.0. Includes downloadable source code in a zip file in the end of the article.</p>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2009/01/07/how-to-create-a-dynamic-xml-reader-in-c-40_227/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# .Net Temperature Struct Code for Fahrenheit and Celsius Manipulation</title>
		<link>http://mycodetrip.com/2009/01/02/c-net-temperature-struct-code-for-fahrenheit-and-celsius-manipulation_209/</link>
		<comments>http://mycodetrip.com/2009/01/02/c-net-temperature-struct-code-for-fahrenheit-and-celsius-manipulation_209/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 04:54:36 +0000</pubDate>
		<dc:creator>Shiva</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[C# .Net]]></category>
		<category><![CDATA[Code Snippet]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=209</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2009/01/02/c-net-temperature-struct-code-for-fahrenheit-and-celsius-manipulation_209/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Helper Class For Indexed Property Access Without Using Subclasses</title>
		<link>http://mycodetrip.com/2009/01/01/c-helper-class-for-indexed-property-access-without-using-subclasses_207/</link>
		<comments>http://mycodetrip.com/2009/01/01/c-helper-class-for-indexed-property-access-without-using-subclasses_207/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 16:28:44 +0000</pubDate>
		<dc:creator>Shiva</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[C# .Net]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=207</guid>
		<description><![CDATA[A C# helper class featuring lambdas that allows for indexed property without using subclasses.]]></description>
			<content:encoded><![CDATA[A C# helper class featuring lambdas that allows for indexed property without using subclasses.]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2009/01/01/c-helper-class-for-indexed-property-access-without-using-subclasses_207/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Dependency Injection and Inversion of Control Containers Explained</title>
		<link>http://mycodetrip.com/2008/12/23/c-dependency-injection-and-inversion-of-control-containers-explained_204/</link>
		<comments>http://mycodetrip.com/2008/12/23/c-dependency-injection-and-inversion-of-control-containers-explained_204/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 18:34:36 +0000</pubDate>
		<dc:creator>Shiva</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[C# .Net]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=204</guid>
		<description><![CDATA[A new approach to understanding Dependency Injection and Inversion of Control Design Patterns in the C# environment. The author, fossmo ]]></description>
			<content:encoded><![CDATA[<p>A new approach to understanding<strong> Dependency Injection</strong> and <strong>Inversion of Control Design Patterns</strong> in the C# environment. The author, <strong>fossmo </strong>uses a Murder Mystery story analogy.</p>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2008/12/23/c-dependency-injection-and-inversion-of-control-containers-explained_204/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Casting Syntax Vs AS Operator &#8211; Which Approach Is Better And Why ?</title>
		<link>http://mycodetrip.com/2008/10/15/casting-syntax-vs-as-operator-which-approach-better-why-performance_105/</link>
		<comments>http://mycodetrip.com/2008/10/15/casting-syntax-vs-as-operator-which-approach-better-why-performance_105/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 23:25:54 +0000</pubDate>
		<dc:creator>Shiva</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[C# .Net]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=105</guid>
		<description><![CDATA[The two most popular approaches to casting &#8211; converting data types and objects  &#8211; in C#  are Using the cast ]]></description>
			<content:encoded><![CDATA[<p>The two most popular approaches to casting &#8211; converting data types and objects  &#8211; in C#  are</p>
<ol>
<li> Using the <strong>cast syntax </strong>i.e. (TypeToBeCastTo) (type/object) and</li>
<li> Using the <strong>AS operator </strong>i.e. (type/object) AS TypeToBeCastTo</li>
</ol>
<p>It is speculated that most developers use the first approach, but have you ever wondered which approach is the better one, is more performance efficient, and why ?</p>
<p>According to <strong>Jon Skeet</strong> (on MSDN), the fundamental difference in the two approaches is as follows.</p>
<ol>
<li> The AS operator returns a null  when the variable you are trying to convert is not of the requested type or in it&#8217;s inheritance chain. The cast syntax, on the other hand, throws an exception.</li>
<li> AS operator can only be used on reference type variables, whereas the cast syntax can be applied to reference and value types.</li>
<li> The AS operator also will not be able to perform conversions on user-defined types, whereas the casting syntax will be able to accomplish this.</li>
</ol>
<p><strong>Performance</strong>: According to <strong>Jon</strong>, the <strong>AS operator syntax </strong>is known to be slightly faster than the casting syntax in <strong>v1.0</strong> and <strong>v1.1</strong>.</p>
<p>Moreover, to me, it makes sense to use the <strong>AS operator</strong> where possible also because it does not throw an exception, which are in general very expensive in terms of performance. Lastly, I think the AS syntax also looks &#8220;more elegant&#8221;.</p>
<p><strong>Further Reading</strong></p>
<ul>
<li><a title="Jon Skeet's C# Frequently Asked Questions " href="http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88420.aspx" target="_blank"> Jon Skeet&#8217;s C# Frequently Asked Questions</a></li>
<li><a title="Ian Griffiths' essay on C#'s approach to Casting" href="http://www.interact-sw.co.uk/iangblog/2004/01/20/casting" target="_blank">Ian Griffiths&#8217; essay on C#&#8217;s approach to Casting</a>. <em>(1500+ words including code).</em></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2008/10/15/casting-syntax-vs-as-operator-which-approach-better-why-performance_105/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB.NET to C# &#8211; Where is the Page_PreRender and other Events ?</title>
		<link>http://mycodetrip.com/2006/12/26/vb-net-to-c-sharp-where-is-page_prerender-and-other-events_42/</link>
		<comments>http://mycodetrip.com/2006/12/26/vb-net-to-c-sharp-where-is-page_prerender-and-other-events_42/#comments</comments>
		<pubDate>Wed, 27 Dec 2006 02:37:03 +0000</pubDate>
		<dc:creator>Shiva</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[C# .Net]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=42</guid>
		<description><![CDATA[Moving from VB.NET to C# - Where is the Page_PreRender and other Events ?]]></description>
			<content:encoded><![CDATA[<p>If you are recently moving from <strong>VB.NET</strong> to <strong>C#</strong>, then one thing you may have noticed is how many different features that you had in VB.NET IDE are now missing in the C# IDE. One such missing feature is the Page Events in the dropdown when you are the code view mode. You will notice that in a new blank webform (.aspx page) the <strong>Page_Load</strong> event is visible, but the <strong>Page_PreRender</strong> and other events are not ? How do you get to them ?</p>
<h2>If you are in Visual Studio 2003 then</h2>
<ul>
<li>Go to the Design View for the .aspx page.</li>
<li>Press F4 to view properties.</li>
<li>From the dropdown of the properties page, choose the class name of your aspx page.</li>
<li>Click the lightening Icon below the class name.</li>
<li>In the list, below Load, you will see PreRender.</li>
<li>Type in a name next to the PreRender. This will be the name for the PreRender event.</li>
<li>Press Enter.</li>
<li>The event will open in the IDE and add a handler for the event in the Web Form Designer generated code.</li>
</ul>
<h2>If you are in a Visual Studio 2005 Master Page then</h2>
<ul>
<li>Go to the Design View for the .aspx page.</li>
<li>Click the <strong>ContentPlaceholder1</strong> on the page to select it.</li>
<li>Press F4 to view properties.</li>
<li>The <strong>ContentPlaceholder1</strong> will be already selected in the dropdown and the lightening Icon will be enabled.</li>
<li>In the list of events below Load, you will see PreRender.</li>
<li>Type in a name next to the PreRender. This will be the name for the PreRender event.</li>
<li>Press Enter.</li>
<li>The event will open in the IDE and add a handler for the event in the Web Form Designer generated code.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2006/12/26/vb-net-to-c-sharp-where-is-page_prerender-and-other-events_42/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>How to enable C# Syntax Highlighting in Textpad</title>
		<link>http://mycodetrip.com/2006/12/26/how-do-i-enable-csharp-asp-net-syntax-highlighting-in-textpad_40/</link>
		<comments>http://mycodetrip.com/2006/12/26/how-do-i-enable-csharp-asp-net-syntax-highlighting-in-textpad_40/#comments</comments>
		<pubDate>Wed, 27 Dec 2006 02:35:16 +0000</pubDate>
		<dc:creator>Shiva</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[C# .Net]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=40</guid>
		<description><![CDATA[Sure, the C# page on Texpad&#8217;s site shows you how to enable syntax highlighting by downloading the syntax definition files ]]></description>
			<content:encoded><![CDATA[<p>Sure, the C# page on Texpad&#8217;s site shows you <a title="how to enable C# syntax highlighting in textpad" rel="nofollow" href="http://www.textpad.com/support/faq/csharp.html#syntax" target="_blank">how to</a> enable syntax highlighting by downloading the syntax definition files for C#, but even this isn&#8217;t necessary. Here is how you enable it for C# without downloading additional syntax files.</p>
<p>Open Textpad and click Configure &gt; <span style="font-weight: bold;">New Document Class</span>.</p>
<p>The <span style="font-weight: bold;">Document Class Wizard</span> will be displayed. In the <span style="font-weight: bold;">document class name</span> box, type a name say, <span style="font-weight: bold;">CSharp </span>and click <span style="font-weight: bold;">Next</span>.</p>
<p><img src="http://img132.imageshack.us/img132/5256/csharpsyntaxhighlightinwp5.jpg" alt="CSharp-Syntax-Highlighting-Texpad-new-document-class" width="441" height="321" /></p>
<p>In the <span style="font-weight: bold;">class members</span> box, type <span style="font-weight: bold;">*.cs </span>and click <span style="font-weight: bold;">Next</span>.</p>
<p>check the <span style="font-weight: bold;">enable syntax highlighting</span> box. From the <span style="font-weight: bold;">syntax definition file</span> dropdown, select <span style="font-weight: bold;">java.syn </span>and click <span style="font-weight: bold;">Next</span>.</p>
<p><img src="http://img412.imageshack.us/img412/4483/csharpsyntaxhighlightinvc3.jpg" alt="CSharp-Syntax-Highlighting-Texpad-select-java" width="441" height="321" /></p>
<p>Now click <span style="font-weight: bold;">Finish </span>to create the new document class.</p>
<p>Open any of your <span style="font-weight: bold;">.cs</span> C# file(s) in textpad. If Microsoft has done as good a job on C# from Java as it did on SQL Server from Sybase -which I think it did &#8211; you should see all the C# keywords and syntax characters highlighted !</p>
<p><img src="http://img72.imageshack.us/img72/7116/csharpsyntaxhighlightinvl8.jpg" alt="syntax-highlighted-in-textpad" width="500" height="337" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2006/12/26/how-do-i-enable-csharp-asp-net-syntax-highlighting-in-textpad_40/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
