<?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>Sanketik &#187; .NET</title>
	<atom:link href="http://blog.sanketik.com/index.php/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sanketik.com</link>
	<description>Next Generation Technology Blog</description>
	<lastBuildDate>Mon, 09 Jan 2012 07:33:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Total instances running of application in C# .NET</title>
		<link>http://blog.sanketik.com/index.php/total-instances-running-of-application-in-c-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=total-instances-running-of-application-in-c-net</link>
		<comments>http://blog.sanketik.com/index.php/total-instances-running-of-application-in-c-net/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 15:31:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Number of instances running]]></category>
		<category><![CDATA[Processes]]></category>

		<guid isPermaLink="false">http://blog.sanketik.com/index.php/total-instances-running-of-application-in-c-net/</guid>
		<description><![CDATA[Total number of instances running of application in C# .NET Many times we needs to find how many instances of particular application or process are running. This can be used in allowing to run only single instance of application or at most 2 etc. Also count can be useful for licensing and other stuff. So [...]]]></description>
			<content:encoded><![CDATA[<h2>Total number of instances running of application in C# .NET</h2>
<p>Many times we needs to find how many instances of particular application or process are running.</p>
<p>This can be used in allowing to run only single instance of application or at most 2 etc.</p>
<p>Also count can be useful for licensing and other stuff.</p>
<p>So here is simple code to find out how many number of instances are running for particular application or process.</p>
<blockquote>
<pre style="font-family: consolas;">    <span style="color: blue;">string</span> fileName = <span style="color: #2b91af;">Process</span>.GetCurrentProcess().MainModule.FileName;</pre>
<pre style="font-family: consolas;">    <span style="color: blue;">int</span> count = 0;</pre>
<pre style="font-family: consolas;">    <span style="color: blue;">foreach</span> (<span style="color: #2b91af;">Process</span> p <span style="color: blue;">in</span> <span style="color: #2b91af;">Process</span>.GetProcesses())</pre>
<pre style="font-family: consolas;">    {</pre>
<pre style="font-family: consolas;">        <span style="color: blue;">try</span></pre>
<pre style="font-family: consolas;"><span style="color: blue;"> </span>        {</pre>
<pre style="font-family: consolas;">            <span style="color: blue;">if</span> (p.MainModule.FileName == fileName)</pre>
<pre style="font-family: consolas;">            {</pre>
<pre style="font-family: consolas;">                count++;</pre>
<pre style="font-family: consolas;">            }</pre>
<pre style="font-family: consolas;">        }</pre>
<pre style="font-family: consolas;">        <span style="color: blue;">catch</span> { }</pre>
<pre style="font-family: consolas;">    }

    <span style="color: #2b91af;">MessageBox</span>.Show(<span style="color: #a31515;">"Total Instances Running are "</span> + count);</pre>
</blockquote>
<p>If you want to do anything additional to this and not aware how to do then please post comment and wait for reply !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/total-instances-running-of-application-in-c-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Take and Skip Partition Operator in LINQ</title>
		<link>http://blog.sanketik.com/index.php/take-and-skip-partition-operator-in-linq/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=take-and-skip-partition-operator-in-linq</link>
		<comments>http://blog.sanketik.com/index.php/take-and-skip-partition-operator-in-linq/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 08:24:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[LINQ Take and Skip Partition Operator]]></category>

		<guid isPermaLink="false">http://blog.sanketik.com/index.php/take-and-skip-partition-operator-in-linq/</guid>
		<description><![CDATA[Many times we have requirement, to fetch partial result set from collection like Arrays, DataTable. To achieve the same we can use Take and Skip Partition Operator of LINQ. Skip Partition Operator Reference: http://msdn.microsoft.com/en-us/library/bb358985.aspx Take Partition Operator Reference: http://msdn.microsoft.com/en-us/library/bb503062.aspx For this we will consider following example of Array Collection. Above example is very simple to [...]]]></description>
			<content:encoded><![CDATA[<p>Many times we have requirement, to fetch partial result set from collection like Arrays, DataTable.</p>
<p>To achieve the same we can use <strong>Take</strong> and <strong>Skip</strong> Partition Operator of <strong>LINQ</strong>.</p>
<p>Skip Partition Operator Reference: <a href="http://msdn.microsoft.com/en-us/library/bb358985.aspx">http://msdn.microsoft.com/en-us/library/bb358985.aspx </a></p>
<p>Take Partition Operator Reference: <a href="http://msdn.microsoft.com/en-us/library/bb503062.aspx">http://msdn.microsoft.com/en-us/library/bb503062.aspx</a></p>
<p>For this we will consider following example of <strong>Array</strong> <strong>Collection</strong>.</p>
<p><a href="http://blog.sanketik.com/wp-content/uploads/2010/03/clip_image001.jpg"><img style="display: inline; border: 0px;" title="clip_image001" src="http://blog.sanketik.com/wp-content/uploads/2010/03/clip_image001_thumb.jpg" border="0" alt="clip_image001" width="510" height="209" /></a></p>
<p>Above example is very simple to understand, we have applied Take and Skip Partition Operator to fetch partial result set.</p>
<p>If you have any queries, regarding the same, please lets me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/take-and-skip-partition-operator-in-linq/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>app.config modification issue in Windows 7</title>
		<link>http://blog.sanketik.com/index.php/app-config-modification-issue-in-windows-7/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=app-config-modification-issue-in-windows-7</link>
		<comments>http://blog.sanketik.com/index.php/app-config-modification-issue-in-windows-7/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 10:27:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[app.config]]></category>
		<category><![CDATA[Common file and registry virtualization]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://blog.sanketik.com/index.php/app-config-modification-issue-in-windows-7/</guid>
		<description><![CDATA[File modification issue in Windows 7 for program files content We have developed many windows application using C# or VB.NET. In that we stored connection string and other required data in ‘app.config’ file, and we modify that file using our application to store latest connection or other information. This is standard practice and works as [...]]]></description>
			<content:encoded><![CDATA[<h3>File modification issue in Windows 7 for program files content</h3>
<p>We have developed many windows application using C# or VB.NET.</p>
<p>In that we stored connection string and other required data in ‘app.config’ file, and we modify that file using our application to store latest connection or other information.</p>
<p>This is standard practice and works as well.</p>
<p>But in ‘Windows 7’ OS architecture is changed in teams of security and other features.</p>
<p>So we can’t modify files which are in % program file % application directory %.</p>
<p>There are there options, run application as administrator. <strong><em>We can run it as admin, but we can’t guarantee that all of our customer will</em></strong> !!!</p>
<p>Other option is keep it same, means write in app.config which will be there in program files.</p>
<p>It will work as desired but ‘<strong><em>content will not be modified in config file from program files</em></strong>’, this is due to one feature of windows 7 called as ‘<strong><em>Common file and registry virtualization</em></strong>’</p>
<p>Whatever you modify in app.config or program files, it will be get modified in virtual file which stored in ‘%userprofile%\AppData\Local\VirtualStore’. And when you try read app.config, it will be read from virtual space rather from program files.</p>
<p><strong>There is no harm with this approach, but you will have to delete the virtual file when you uninstall the application.</strong></p>
<p><strong> </strong></p>
<p>The other and safe way for this issue is to use ‘<strong>application data</strong>’ space of windows OS. All the major applications including word, outlook stores there data in app data.</p>
<p>So it is good habit to store your data there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/app-config-modification-issue-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Coding Standards in .NET : Naming Guidelines</title>
		<link>http://blog.sanketik.com/index.php/coding-standards-in-net-naming-guidelines/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=coding-standards-in-net-naming-guidelines</link>
		<comments>http://blog.sanketik.com/index.php/coding-standards-in-net-naming-guidelines/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 08:49:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Coding Standards]]></category>
		<category><![CDATA[Naming Guidelines]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://thoughts.blog.sanketik.com/index.php/coding-standards-in-net-naming-guidelines/</guid>
		<description><![CDATA[A comprehensive coding standard is essential for a successful product delivery. The standard helps in enforcing best practices and avoiding pitfalls, and makes knowledge dissemination across the team easier. The C# coding standard presented here is very thin on the “why” and very detailed on the “what” and the “how.” The coding standard presented next [...]]]></description>
			<content:encoded><![CDATA[<p><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium &#39;Times New Roman&#39;; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="text-align: left; font-family: verdana, tahoma, arial, sans-serif; color: rgb(68,68,68); font-size: 11px" class="Apple-style-span"><br />
<table style="border-bottom: medium none; border-left: medium none; border-collapse: collapse; background: #f2dbdb; border-top: medium none; border-right: medium none; mso-background-themecolor: accent2; mso-background-themetint: 51; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<td style="border-bottom: black 1pt solid; border-left: black 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; width: 6.65in; padding-right: 5.4pt; border-top: black 1pt solid; border-right: black 1pt solid; padding-top: 0in; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" valign="top" width="638">
<p style="line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" class="MsoNormal"><span style="color: black; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-font-kerning: 18.0pt; mso-bidi-font-weight: bold; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin">A comprehensive coding standard is essential for a successful product delivery. The standard helps in enforcing best practices and avoiding pitfalls, and makes knowledge dissemination across the team easier. The C# coding standard presented here is very thin on the “why” and very detailed on the “what” and the “how.” The coding standard presented next captures best practices, dos and don&#8217;ts, pitfalls, guidelines, and recommendations, as well as naming conventions and styles, project settings and structure, and framework specific guidelines.</span></p>
</td>
</tr>
</tbody>
</table>
<p style="text-indent: -18.75pt; background: white; margin-left: 36.75pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"></span></span></p>
<h2>Coding Standards in .NET : Naming Guidelines</h2>
<p>&#160;</p>
<p>1). Private Variables (Fields in C#) Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Prefix private variables with a &quot;_&quot; and Hungarian-style notation.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use camel case as a general rule, or uppercase for very small words</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">_s</span>tr</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">F</span>irst</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">N</span>ame,<span class="Apple-converted-space">&#160;</span></strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">_d</span>set</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">E</span>mployees</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: blue; font-size: 11px; padding-top: 0px">// Field</span>        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />private OleDbConnection<span class="Apple-converted-space">&#160;</span><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">_</span>connection</strong>;</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: blue; font-size: 11px; padding-top: 0px">// Property</span>        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />public OleDbConnection Connection        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />{        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />&#160; get { return<span class="Apple-converted-space">&#160;</span><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">_</span></strong>connection; }        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />&#160; set {<span class="Apple-converted-space">&#160;</span><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">_c</span></strong>onnection = value; }        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />}</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">2). Local Variables Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Prefix private or local variables with Hungarian-style notation.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use camel case as a general rule, or uppercase for very small words</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">strFirstName, dsetEmployees</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">3). Namespace Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">The general rule for naming namespaces is to use the company name followed by the technology name and optionally the feature and design as follows:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">CompanyName.TechnologyName[.Feature][.Design]</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Prefixing namespace names with a company name or other well-established brand avoids the possibility of two published namespaces having the same name. Use a stable, recognized technology name at the second level of a hierarchical name.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">Akadia.Traffic</span>, System.Web.UI, System.Windows.Forms</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use Pascal case as a general rule, or uppercase for very small words.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">System.Windows.Forms, System.Web.UI</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">&#160;</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">4). Class Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use a noun or noun phrase to name a class.<span class="Apple-converted-space">&#160;</span>        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />Do not use a type prefix, such as C for class, on a class name.        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />Do not use the underscore character (_).</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use Pascal case. Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">Fi</span>le</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">S</span>tream, Button</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">5). Interface Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Prefix interface names with the letter<strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span class="Apple-converted-space">&#160;</span>&quot;I&quot;,</strong><span class="Apple-converted-space">&#160;</span>to indicate that the type is an interface.        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />Do not use the underscore character (_).</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use Pascal case. Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">I</span>ServiceProvider,<span class="Apple-converted-space">&#160;</span></strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">I</span>Formatable</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">6). Parameter Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use descriptive parameter names. Parameter names should be descriptive enough that the name of the parameter and its type can be used to determine its meaning in most scenarios. To distinguish parameters from other variables the prefix<span class="Apple-converted-space">&#160;</span><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">&quot;p&quot;<span class="Apple-converted-space">&#160;</span></strong>should be used.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Do not prefix parameter names with Hungarian type notation.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Do not use a prefix for parameter names of an event handler and exceptions.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use camel case. Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">p</span>TypeName,<span class="Apple-converted-space">&#160;</span></strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">p</span>NumberOfItems</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">&#160;</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">&#160;</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">7). Method Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use verbs or verb phrases to name methods.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use Pascal case. Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">R</span>emove</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">A</span>ll(),<span class="Apple-converted-space">&#160;</span></strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">G</span>et</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">C</span>har</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">A</span>t()</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">8). Property / Enumerations Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use a noun or noun phrase to name properties.       <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />Do not use Hungarian notation.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use Pascal case. Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">B</span>ack</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">C</span>olor, NumberOfItems</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">9). Event Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use an EventHandler suffix on event handler names.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Specify two parameters named sender and e. The sender parameter represents the object that raised the event. The sender parameter is always of type object, even if it is possible to use a more specific type. The state associated with the event is encapsulated in an instance of an event class named<span class="Apple-converted-space">&#160;</span><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">&quot;e&quot;</strong>. Use an appropriate and specific event class for the e parameter type.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Name an event argument class with the<span class="Apple-converted-space">&#160;</span><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">EventArgs</strong><span class="Apple-converted-space">&#160;</span>suffix.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Case guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Use Pascal case. Example:</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">public delegate void MouseEventHandler(object sender, Mouse</strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">EventArgs</span><span class="Apple-converted-space">&#160;</span></strong><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">e</span>);</strong></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">&#160;</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">&#160;</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">9). Exception Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="Header1">Naming guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Event handlers in Visual Studio .NET tend to use an &quot;e&quot; parameter for the event parameter to the call. To ensure we avoid a conflict, we will use &quot;<strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">ex</strong>&quot; as a standard variable name for an Exception object.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Example</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">catch (Exception<span class="Apple-converted-space">&#160;</span><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: red; font-size: 11px; padding-top: 0px">ex</span></strong>)        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />{        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />&#160; // Handle Exception        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" />}</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="big">10). Constant Naming Guidelines</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">The names of variables declared class constants should be all uppercase with words separated by underscores. It is recommended to use a grouping naming schema.</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="verdana">Example (for group AP_WIN):</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 0px 0px 1em 0.5in; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; padding-top: 0px" class="courier"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(68,68,68); font-size: 11px; font-weight: bold; padding-top: 0px">AP_WIN_MIN_WIDTH, AP_WIN_MAX_WIDTH, AP_WIN_MIN_HIGHT, AP_WIN_MAX_HIGHT</strong></p>
<p>   </span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/coding-standards-in-net-naming-guidelines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Standard Coding Practices in .NET</title>
		<link>http://blog.sanketik.com/index.php/standard-coding-practices-in-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=standard-coding-practices-in-net</link>
		<comments>http://blog.sanketik.com/index.php/standard-coding-practices-in-net/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 08:01:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming Guide]]></category>
		<category><![CDATA[Standard Coding Practices]]></category>

		<guid isPermaLink="false">http://thoughts.blog.sanketik.com/index.php/standard-coding-practices-in-net/</guid>
		<description><![CDATA[A comprehensive coding standard is essential for a successful product delivery. The standard helps in enforcing best practices and avoiding pitfalls, and makes knowledge dissemination across the team easier. The C# coding standard presented here is very thin on the “why” and very detailed on the “what” and the “how.” The coding standard presented next [...]]]></description>
			<content:encoded><![CDATA[<table style="border-bottom: medium none; border-left: medium none; border-collapse: collapse; background: #f2dbdb; border-top: medium none; border-right: medium none; mso-background-themecolor: accent2; mso-background-themetint: 51; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<td style="border-bottom: black 1pt solid; border-left: black 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; width: 6.65in; padding-right: 5.4pt; border-top: black 1pt solid; border-right: black 1pt solid; padding-top: 0in; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" valign="top" width="638">
<p style="line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" class="MsoNormal"><span style="color: black; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-font-kerning: 18.0pt; mso-bidi-font-weight: bold; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin">A comprehensive coding standard is essential for a successful product delivery. The standard helps in enforcing best practices and avoiding pitfalls, and makes knowledge dissemination across the team easier. The C# coding standard presented here is very thin on the “why” and very detailed on the “what” and the “how.” The coding standard presented next captures best practices, dos and don&#8217;ts, pitfalls, guidelines, and recommendations, as well as naming conventions and styles, project settings and structure, and framework specific guidelines.</span></p>
</td>
</tr>
</tbody>
</table>
<p style="text-indent: -18.75pt; background: white; margin-left: 36.75pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"></span></span></p>
<h2>Standard Coding Practices in .NET</h2>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"></span></span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid putting multiple classes in a single file.&#160; </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">A single file should contribute types to only a single namespace. Avoid having multiple namespaces in the same file. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid files with more than 500 lines (excluding machine-generated code). </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid methods with more than 200 lines. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid methods with more than 5 arguments. Use structures for passing multiple arguments.&#160;&#160; </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Lines should not exceed 120 characters. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Do not manually edit any machine-generated code.&#160; </span></p>
<p><span style="font-family: &quot;Courier New&quot;; color: black; font-size: 11pt; mso-fareast-font-family: &#39;Courier New&#39;"><span style="mso-list: ignore">&#160;&#160;&#160; o<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">If modifying machine generated code, modify the format and style to match this coding standard. </span></p>
<p><span style="font-family: &quot;Courier New&quot;; color: black; font-size: 11pt; mso-fareast-font-family: &#39;Courier New&#39;"><span style="mso-list: ignore">&#160;&#160;&#160; o<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Use partial classes whenever possible to factor out the maintained portions. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid comments that explain the obvious. Code should be self-explanatory. Good code with readable variable and method names should not require comments. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Document only operational assumptions, algorithm insights and so on.&#160;&#160; </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid method-level documentation. </span></p>
<p><span style="font-family: &quot;Courier New&quot;; color: black; font-size: 11pt; mso-fareast-font-family: &#39;Courier New&#39;"><span style="mso-list: ignore">&#160;&#160;&#160; o<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Use extensive external documentation for API documentation. </span></p>
<p><span style="font-family: &quot;Courier New&quot;; color: black; font-size: 11pt; mso-fareast-font-family: &#39;Courier New&#39;"><span style="mso-list: ignore">&#160;&#160;&#160; o<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Use method-level comments only as tool tips for other developers. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">With the exception of zero and one, never hard-code a numeric value; always declare a constant instead.&#160; </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Use the const directive only on natural constants such as the number of days of the week.&#160; </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid using const on read-only variables. For that, use the readonly directive. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Assert every assumption. On average, every fifth line is an assertion. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Every line of code should be walked through in a “white box” testing manner.&#160; </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Catch only exceptions for which you have explicit handling. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">In a catch statement that throws an exception, always throw the original exception (or another exception constructed from the original exception) to maintain the stack location of the original error: </span></p>
<p><span style="color: black; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin">Catch (Exception exception) </span></p>
<p><span style="color: black; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin">{&#160;&#160;&#160; </span></p>
<p><span style="color: black; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin">&#160;&#160; MessageBox.Show(exception.Message); </span></p>
<p><span style="color: black; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin">&#160;&#160; throw; </span></p>
<p><span style="color: black; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin">} </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid error codes as method return values.&#160; </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid defining custom exception classes. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">When defining custom exceptions: </span></p>
<p><span style="font-family: &quot;Courier New&quot;; color: black; font-size: 11pt; mso-fareast-font-family: &#39;Courier New&#39;"><span style="mso-list: ignore">&#160;&#160; o<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Derive the custom exception from Exception. </span></p>
<p><span style="font-family: &quot;Courier New&quot;; color: black; font-size: 11pt; mso-fareast-font-family: &#39;Courier New&#39;"><span style="mso-list: ignore">&#160;&#160; o<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Provide custom serialization.&#160; </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid multiple Main () methods in a single assembly. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Make only the most necessary types public, mark others as internal. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid friend assemblies, as they increase inter-assembly coupling. </span></p>
<p><span style="font-family: symbol; color: black; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Avoid code that relies on an assembly running from a particular location. </span></p>
<p><span style="font-family: symbol; font-size: 11pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black; font-size: 11pt; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">Minimize code in application assemblies (EXE client assemblies). Use class libraries instead to contain business logic. </span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/standard-coding-practices-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transport level security VS message level security in WCF</title>
		<link>http://blog.sanketik.com/index.php/transport-level-security-vs-message-level-security-in-wcf/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=transport-level-security-vs-message-level-security-in-wcf</link>
		<comments>http://blog.sanketik.com/index.php/transport-level-security-vs-message-level-security-in-wcf/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 10:07:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[Message level security]]></category>
		<category><![CDATA[Transport level security]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://oddz.sanbuzz.com/index.php/transport-level-security-vs-message-level-security-in-wcf/</guid>
		<description><![CDATA[Transport level security VS message level security in WCF &#160; Advantages of Transport level security Does not need any extra coding as protocol inherent security is used. Performance is better as we can use hardware accelerators to enhance performance. There is lot of interoperability support and communicating clients do not need to understand WS security [...]]]></description>
			<content:encoded><![CDATA[<h2>Transport level security VS message level security in WCF</h2>
<p>&#160;</p>
<h3>Advantages of Transport level security</h3>
<ul>
<li>Does not need any extra coding as protocol inherent security is used. </li>
<li>Performance is better as we can use hardware accelerators to enhance performance. </li>
<li>There is lot of interoperability support and communicating clients do not need to understand WS security as it’s built in the protocol itself.</li>
</ul>
<h3>Disadvantages of Transport level security</h3>
<ul>
<li>As it’s a protocol implemented security so it works only point to point. </li>
<li>As security is dependent on protocol it has limited security support and is bounded to the protocol security limitations.</li>
</ul>
<h3>Advantages of Message level security</h3>
<ul>
<li>Provides end to end security as it’s not dependent on protocol. Any intermediate hop in network does not affect the application. </li>
<li>Supports wide set of security options as it is not dependent on protocol. We can also implement custom security</li>
</ul>
<h3>Disadvantages of Message level security</h3>
<ul>
<li>Needs application refactoring to implement security. </li>
<li>As every message is encrypted and signed there are performance issues. </li>
<li>Does not support interoperability with old ASMX webservices</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/transport-level-security-vs-message-level-security-in-wcf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WCF Security modes provided in .NET</title>
		<link>http://blog.sanketik.com/index.php/wcf-security-modes-provided-in-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-security-modes-provided-in-net</link>
		<comments>http://blog.sanketik.com/index.php/wcf-security-modes-provided-in-net/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 09:42:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://oddz.sanbuzz.com/index.php/wcf-security-modes-provided-in-net/</guid>
		<description><![CDATA[WCF Security modes provided in .NET Across all service bindings there are five possible security modes: None. Turns security off. Transport. Uses transport security for mutual authentication and message protection. Message. Uses message security for mutual authentication and message protection. Both. Allows you to supply settings for transport and message-level security (only MSMQ supports this). [...]]]></description>
			<content:encoded><![CDATA[<h2>WCF Security modes provided in .NET</h2>
<p>Across all service bindings there are five possible security modes:</p>
<ul>
<li><b>None</b>. Turns security off.</li>
<li><b>Transport</b>. Uses transport security for mutual authentication and message protection.</li>
<li><b>Message</b>. Uses message security for mutual authentication and message protection.</li>
<li><b>Both</b>. Allows you to supply settings for transport and message-level security (only MSMQ supports this).</li>
<li><b>TransportWithMessageCredential</b>. Credentials are passed with the message and message protection and server authentication are provided by the transport layer.</li>
<li><b>TransportCredentialOnly. </b>Client credentials are passed with the transport layer and no message protection is applied</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/wcf-security-modes-provided-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Default types of WCF bindings in .NET</title>
		<link>http://blog.sanketik.com/index.php/default-types-of-wcf-bindings-in-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=default-types-of-wcf-bindings-in-net</link>
		<comments>http://blog.sanketik.com/index.php/default-types-of-wcf-bindings-in-net/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 09:37:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WCF bindings]]></category>

		<guid isPermaLink="false">http://oddz.sanbuzz.com/index.php/default-types-of-wcf-bindings-in-net/</guid>
		<description><![CDATA[Default types of WCF bindings in .NET &#160; Within the Windows Communication Foundation programming model, bindings are represented by the System.ServiceModel.Channels.Binding class. All binding classes must derive from this base class. Following are the different bindings provided by WCF by default: 1. BasicHttpBinding 2. WSHttpBinding 3. WSDualHttpBinding 4. WSFederationHttpBinding 5. NetTcpBinding 6. NetPeerTcpBinding 7. NetNamedPipesBinding [...]]]></description>
			<content:encoded><![CDATA[<h2>Default types of WCF bindings in .NET</h2>
<p>&#160;</p>
<p>Within the Windows Communication Foundation programming model, bindings are represented by the System.ServiceModel.Channels.Binding class. All binding classes must derive from this base class. </p>
<p>Following are the different bindings provided by WCF by default:</p>
<p>1. BasicHttpBinding </p>
<p>2. WSHttpBinding </p>
<p>3. WSDualHttpBinding </p>
<p>4. WSFederationHttpBinding </p>
<p>5. NetTcpBinding </p>
<p>6. NetPeerTcpBinding </p>
<p>7. NetNamedPipesBinding </p>
<p>8. NetMsmqBinding </p>
<p>9. MsmqIntegrationBinding </p>
<p>10. CustomBinding</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/default-types-of-wcf-bindings-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client Credential Type in WCF</title>
		<link>http://blog.sanketik.com/index.php/client-credential-type-in-wcf/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=client-credential-type-in-wcf</link>
		<comments>http://blog.sanketik.com/index.php/client-credential-type-in-wcf/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 09:46:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://oddz.sanbuzz.com/index.php/client-credential-type-in-wcf/</guid>
		<description><![CDATA[Different Client Credential Type provided in WCF – Windows communication foundation &#160; The choice of client credential type depends on the security mode in place. For transport security you can require a Windows credential or certificate-and there are variations on how Windows credentials are passed via TCP, HTTP and MSMQ. Message security supports any of [...]]]></description>
			<content:encoded><![CDATA[<h2>Different Client Credential Type provided in WCF – Windows communication foundation</h2>
<p>&#160;</p>
<p>The choice of client credential type depends on the security mode in place. For transport security you can require a Windows credential or certificate-and there are variations on how Windows credentials are passed via TCP, HTTP and MSMQ. Message security supports any of the following settings for <i>clientCredentialType</i>:</p>
<ul>
<li>None </li>
<li>Windows </li>
<li>UserName </li>
<li>Certificate </li>
<li>IssuedToken </li>
</ul>
<p>You can set anyone of above as clientCredentialType in web.config as shown below:</p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 10pt; mso-no-proof: yes">wsHttpBinding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">&gt;</span></p>
<p><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 10pt; mso-no-proof: yes">binding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt; mso-no-proof: yes">name</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">&quot;<span style="color: blue">wsHttp</span>&quot;<span style="color: blue">&gt;</span></span></p>
<p> <span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 10pt; mso-no-proof: yes">security</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt; mso-no-proof: yes">mode</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">&quot;<span style="color: blue">Message</span>&quot;<span style="color: blue">&gt;</span></span>&#160;
<p><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 10pt; mso-no-proof: yes">message</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt; mso-no-proof: yes">clientCredentialType</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">&quot;<span style="color: blue">UserName</span>&quot;<span style="color: blue"> /&gt;</span></span> </p>
<p><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 10pt; mso-no-proof: yes">security</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">&gt;</span></p>
<p><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 10pt; mso-no-proof: yes">binding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">&gt;</span></p>
<p><span style="line-height: 115%; font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160; </span>&lt;/</span><span style="line-height: 115%; font-family: &quot;Courier New&quot;; color: #a31515; font-size: 10pt; mso-no-proof: yes">wsHttpBinding</span><span style="line-height: 115%; font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">&gt;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/client-credential-type-in-wcf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Is Message level Security in WCF?</title>
		<link>http://blog.sanketik.com/index.php/what-is-message-security-in-wcf/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-message-security-in-wcf</link>
		<comments>http://blog.sanketik.com/index.php/what-is-message-security-in-wcf/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 10:12:00 +0000</pubDate>
		<dc:creator>Sanket</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://oddz.sanbuzz.com/index.php/what-is-message-security-in-wcf/</guid>
		<description><![CDATA[What Is Message level Security in WCF? &#160; Message security uses the WS-Security specification to secure messages. The specification describes enhancements to SOAP messaging to ensure confidentiality, integrity, and authentication at the SOAP message level (instead of the transport level). In brief, message security differs from transport security by encapsulating the security credentials and claims [...]]]></description>
			<content:encoded><![CDATA[<h2>What Is Message level Security in WCF?</h2>
<p>&#160;</p>
<p>Message security uses the WS-Security specification to secure messages. The specification describes enhancements to SOAP messaging to ensure confidentiality, integrity, and authentication at the SOAP message level (instead of the transport level).</p>
<p>In brief, message security differs from transport security by encapsulating the security credentials and claims with every message along with any message protection (signing or encryption). Applying the security directly to the message by modifying its content allows the secured message to be self-containing with respect to the security aspects. This enables some scenarios that are not possible when transport security is used.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sanketik.com/index.php/what-is-message-security-in-wcf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

