<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Tanveer-Ibn Haresh</title>
        <link>http://geekswithblogs.net/Shuvo/Default.aspx</link>
        <description> </description>
        <language>en-US</language>
        <copyright>Tanveer-Ibn-Haresh</copyright>
        <managingEditor>ta_haresh@hotmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Tanveer-Ibn Haresh</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/Shuvo/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>General Tips</title>
            <link>http://geekswithblogs.net/Shuvo/archive/2009/10/26/general-tips.aspx</link>
            <description>1)To ensure debugging of  Javascript with VS2008 IDE, you have to make some changes in Internet Explorer.&lt;br /&gt;
In IE, Go to Tools---&amp;gt;Internet Options. Then in the Advanced Tab, make sure both the following check boxes are unchecked.&lt;br /&gt;
i) Disable script debugging (Internet Explorer)&lt;br /&gt;
ii) Disable script debugging (Other). &lt;img src="http://geekswithblogs.net/Shuvo/aggbug/135713.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanveer-Ibn-Haresh</dc:creator>
            <guid>http://geekswithblogs.net/Shuvo/archive/2009/10/26/general-tips.aspx</guid>
            <pubDate>Mon, 26 Oct 2009 07:36:36 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Shuvo/comments/135713.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Shuvo/archive/2009/10/26/general-tips.aspx#feedback</comments>
            <slash:comments>18</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Shuvo/comments/commentRss/135713.aspx</wfw:commentRss>
        </item>
        <item>
            <title>FootNotes on C# Generics</title>
            <category>C#</category>
            <link>http://geekswithblogs.net/Shuvo/archive/2009/03/23/footnotes-on-c-generics.aspx</link>
            <description>&lt;link rel="File-List" href="file:///C:\DOCUME~1\tih\LOCALS~1\Temp\msohtmlclip1\01\clip_filelist.xml" /&gt;
&lt;link rel="themeData" href="file:///C:\DOCUME~1\tih\LOCALS~1\Temp\msohtmlclip1\01\clip_themedata.thmx" /&gt;
&lt;link rel="colorSchemeMapping" href="file:///C:\DOCUME~1\tih\LOCALS~1\Temp\msohtmlclip1\01\clip_colorschememapping.xml" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267"&gt;
&lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal" /&gt;
&lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 1" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 2" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 3" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 4" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 5" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 6" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 7" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 8" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 9" /&gt;
&lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /&gt;
&lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title" /&gt;
&lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /&gt;
&lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /&gt;
&lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong" /&gt;
&lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid" /&gt;
&lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /&gt;
&lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /&gt;
&lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /&gt;
&lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote" /&gt;
&lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /&gt;
&lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /&gt;
&lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title" /&gt;
&lt;w:LsdException Locked="false" Priority="37" Name="Bibliography" /&gt;
&lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
	{font-family:Cambria;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073741899 0 0 159 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
h1
	{mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-link:"Heading 1 Char";
	mso-style-next:Normal;
	margin-top:24.0pt;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	line-height:115%;
	mso-pagination:widow-orphan lines-together;
	page-break-after:avoid;
	mso-outline-level:1;
	font-size:14.0pt;
	font-family:"Cambria","serif";
	mso-ascii-font-family:Cambria;
	mso-ascii-theme-font:major-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:major-fareast;
	mso-hansi-font-family:Cambria;
	mso-hansi-theme-font:major-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:major-bidi;
	color:#365F91;
	mso-themecolor:accent1;
	mso-themeshade:191;
	mso-font-kerning:0pt;}
span.Heading1Char
	{mso-style-name:"Heading 1 Char";
	mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:"Heading 1";
	mso-ansi-font-size:14.0pt;
	mso-bidi-font-size:14.0pt;
	font-family:"Cambria","serif";
	mso-ascii-font-family:Cambria;
	mso-ascii-theme-font:major-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:major-fareast;
	mso-hansi-font-family:Cambria;
	mso-hansi-theme-font:major-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:major-bidi;
	color:#365F91;
	mso-themecolor:accent1;
	mso-themeshade:191;
	font-weight:bold;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;To declare a list of&lt;span&gt;  &lt;/span&gt;objects &lt;span&gt; &lt;/span&gt;of type T &lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;List&amp;lt;T&amp;gt; list=new List&amp;lt;T&amp;gt;();&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Here T is a parametric Type. You can use any data type&lt;span&gt;  &lt;/span&gt;or class in place of the T.&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;List&amp;lt;int&amp;gt; list=new List&amp;lt;int&amp;gt;(); &lt;/p&gt;
&lt;p class="MsoNormal"&gt;Here, List is a collection of objects of type integer. &lt;/p&gt;
&lt;p class="MsoNormal"&gt;Now if you write..&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;list.add(1);&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;list.add(2);&lt;/p&gt;
&lt;p class="MsoNormal"&gt;It will execute successfully .But if you just write &lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;list.add(3.0);&lt;/p&gt;
&lt;p class="MsoNormal"&gt;It will throw a runtime exception because 3.0 is not of integer type and the generic list has been declared as type integer.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;This is how you declare a generic type class:&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt; class FirstList&amp;lt;T&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;}&lt;/p&gt;
&lt;p class="MsoNormal"&gt;So T&lt;span&gt;  &lt;/span&gt;acts as a constructor parameter, which defines the type for the generic. Some interesting facts about the execution cycle of generics should be discussed here.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;If you declare and instantiate MyList Like bellow:&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;First&lt;/span&gt;List&amp;lt;int&amp;gt; list1=new &lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;First&lt;/span&gt;List&amp;lt;int&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;First&lt;/span&gt;List&amp;lt;int&amp;gt; list2=new &lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;First&lt;/span&gt;List&amp;lt;int&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 255); line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;First&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;list&amp;lt;double&amp;gt;  list3=new FirstList&amp;lt;double&amp;gt;();&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Normal situation suggests that we have only one class there with 3 instances. But if we dig deep we will find out that there are two classes here . FirstList[System.Int32]&lt;span&gt;   &lt;/span&gt;which has 2 instances and FirstList[System.Double], which has one instance. Interesting thing is that , in IL level, there is only one class FirstList&amp;lt;T&amp;gt;.So where does these 2 classes come from? When are they created. Interesting to know that the instances of these two types of classes are created in runtime by the CLR when the code is loaded in the memory. That gives the system a great performance overhead. So the classes are only created when they are needed, which is a very efficient way of programming.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Now lets talk about Generic methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;public T Max&amp;lt;T&amp;gt;(T val1, T val2) where T : IComparable&lt;span&gt;  &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span&gt;    &lt;/span&gt;T FinalVal = val2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span&gt;    &lt;/span&gt;if (val2.CompareTo(val1) &amp;lt; 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span&gt;        &lt;/span&gt;FinalVal = val1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span&gt;    &lt;/span&gt;return FinalVal;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;   }&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;The method here is called Max and it has become a parameterized type. It accepts a type parameter, which is the signature for any Generic method. So whatever type you pass on in the type parameter, can be referenced within the method. Note that as it is declared as Type T, the return type of the function will be also of that parameterized type. Look at the second part of the function declaration. The ‘where’ section shows how to implement constraints on the Generic methods. By constraint here, we say the compiler that, the parametric type T has to implement the IComparable interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;“A derived class inherits a base class, but a collection of derived class, doesn’t inherit a collection of base class”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Lets say we have 3 classes like these:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;class Furniture{}&lt;span&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;class Table{}:Furniture{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class Chair{}:Furniture{}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Suppose we have a method in Furniture class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static void Make(Furniture f){}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Here if we pass a table or chair object, that would also compile successfully.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Make(Table t);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Make(Chair c);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;If we override the Make method in the derived class Table as:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;public override Make(Furniture F)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; color: rgb(0, 0, 255); line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span&gt;         &lt;/span&gt;base.Make(F);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;There is a problem, we can even pass an object&lt;span&gt;  &lt;/span&gt;of class Chair&lt;span&gt;  &lt;/span&gt;in this method. So a Table class can even make a Chair.Many programmers would not want that to happen. Here comes the use of generics.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 7.5pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;“A derived class inherits a base class, but a collection of derived class, doesn’t inherit a collection of base class”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Lets&lt;span&gt;  &lt;/span&gt;say we have a method &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static void Make(FirstList&amp;lt;Furniture&amp;gt;  furniture){}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;So if we invoke the method as &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;Make(new FirstList&amp;lt;Furniture&amp;gt; &lt;span&gt; &lt;/span&gt;furniture);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;It would compile successfully. But if we try something like this&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Make(new FirstList&amp;lt;Table&amp;gt; table);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;It will raise a compile time error. Why? Because a object of Table class do inherit&lt;span&gt;  &lt;/span&gt;base class Furniture, but a list or collection of Table objects do not inherit a list or collection of Furniture class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Lets &lt;span&gt; &lt;/span&gt;see this example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;class Furniture&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public&lt;span&gt;  &lt;/span&gt;virtual&lt;span&gt;  &lt;/span&gt;void Paint(FirstList&amp;lt;Furniture&amp;gt; furnitures ) {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public class &lt;span&gt; &lt;/span&gt;Table:Furniture&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public&lt;span&gt;  &lt;/span&gt;override&lt;span&gt;  &lt;/span&gt;void Paint(FirstList&amp;lt;Furniture&amp;gt; furnitures ) {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public class&lt;span&gt;  &lt;/span&gt;Chair:Furniture&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public&lt;span&gt;  &lt;/span&gt;override&lt;span&gt;  &lt;/span&gt;void Paint(FirstList&amp;lt;Furniture&amp;gt; furnitures ) {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Now if we test the new classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;class&lt;span&gt;  &lt;/span&gt;Program&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span&gt;                &lt;/span&gt;Static void Main(string[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255); text-indent: 0.5in;" class="MsoNormal"&gt;Table table=new Table();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255); text-indent: 0.5in;" class="MsoNormal"&gt;Table.Paint(new FirstList&amp;lt;Furniture&amp;gt;());&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255); text-indent: 0.5in;" class="MsoNormal"&gt;Table.Paint(new FirstList&amp;lt;Table&amp;gt;());&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255); text-indent: 0.5in;" class="MsoNormal"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;If we execute this code, the first 2 lines will execute, but it would raise error in the 3&lt;sup&gt;rd&lt;/sup&gt; line. Why? The Table class can’t even Paint its on instance. Table is a child class of Furniture and there might be some situations where we would like that the table class has&lt;span&gt;  &lt;/span&gt;the capability to paint Chair objects also. How would&lt;span&gt;  &lt;/span&gt;we establish that?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Lets make some improvements in our classes. Make the methods generic methods. Lets change all the 3 Paint methods with this new one.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public&lt;span&gt;  &lt;/span&gt;override&lt;span&gt;  &lt;/span&gt;void Paint&amp;lt;T&amp;gt;(FirstList&amp;lt;T&amp;gt; furnitures ) {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;So now we will see if we execute&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;Table.Paint(new FirstList&amp;lt;Table&amp;gt;());&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Table.Paint(new FirstLIst&amp;lt;Chair&amp;gt;());&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Both these lines will execute successfully. Oh, good work? Well, isn’t there a glitch? Let us run this..&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Table.Paint(new FIrstList&amp;lt;Program&amp;gt;());&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Oops, it is executing without any error. Should we let that happen? Shouldn’t we make sure that it can only pain derived classes of the Furniture. So lets do it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;What we have to do here is to put a constraint in the method declaration of the base class that is Furniture. Lets do it like this.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public&lt;span&gt;  &lt;/span&gt;override&lt;span&gt;  &lt;/span&gt;void Paint&amp;lt;T&amp;gt;(FirstList&amp;lt;T&amp;gt; furnitures ) where T : Furniture&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; {}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;So we are making sure here that&lt;span&gt;  &lt;/span&gt;any type passed in the parameterized type variable T is indeed a derived class of base class that is Furniture here. Remember that putting this constraint only in the base class would be enough, we don’t have to repeat it in the child classes again.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Now lets make some changes in our generic class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt; class FirstList&amp;lt;T&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public&lt;span&gt;  &lt;/span&gt;void&lt;span&gt;  &lt;/span&gt;Insert(T obj)&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;}&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public&lt;span&gt;  &lt;/span&gt;void &lt;span&gt; &lt;/span&gt;Push (()&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;               &lt;/span&gt;Insert(new T());&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;}&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;}&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Now if we compile this, we would get an error. In the line add(new T()). That is because T is a generic&lt;span&gt;  &lt;/span&gt;parameter Type and remember that all classes do not have a parameterless constructor. So to make it work we will have to add a constraint in the class declaration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt; class FirstList&amp;lt;T&amp;gt; where T : new()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;………...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;So it defines that any type passed as the parameter type in the class would have to have a parameterless constructor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;So if you &lt;span&gt; &lt;/span&gt;modify the class furniture like this&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;class Furniture&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p style="color: rgb(0, 0, 255);" class="MsoNormal"&gt;public&lt;span&gt;  &lt;/span&gt;virtual&lt;span&gt;  &lt;/span&gt;void Paint&amp;lt;T&amp;gt;(FirstList&amp;lt;T&amp;gt; furnitures ) {}&lt;span&gt;  &lt;/span&gt;where T:&lt;span&gt;  &lt;/span&gt;Furniture&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In this case we would get an error here.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;“'T' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ConsoleApplication1.MyList&amp;lt;T&amp;gt;'”&lt;/p&gt;
&lt;p class="MsoNormal"&gt;This is happening because FirstList&lt;span&gt;  &lt;/span&gt;as a generic type expects the type parameter to have parameterless constructor. So if we change the generic method declaration as &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public  virtual  void Paint&amp;lt;T&amp;gt;(FirstList&amp;lt;T&amp;gt; furnitures ) {}  where T:  Furniture,new()&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Our problem will be solved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;o:p&gt; Inspired by Presentation on www.dnrTv.com&lt;br /&gt;
&lt;/o:p&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/Shuvo/aggbug/130320.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanveer-Ibn-Haresh</dc:creator>
            <guid>http://geekswithblogs.net/Shuvo/archive/2009/03/23/footnotes-on-c-generics.aspx</guid>
            <pubDate>Mon, 23 Mar 2009 19:09:37 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Shuvo/comments/130320.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Shuvo/archive/2009/03/23/footnotes-on-c-generics.aspx#feedback</comments>
            <slash:comments>61</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Shuvo/comments/commentRss/130320.aspx</wfw:commentRss>
        </item>
        <item>
            <title>XPath Query</title>
            <category>XML,XSLT,XPath</category>
            <link>http://geekswithblogs.net/Shuvo/archive/2009/02/18/xpath-query.aspx</link>
            <description>There are many tutorials explaining the syntax's of  XPathQuery. What gets me confused sometimes is the understanding of the match and select statements of the templates. Here is a simple example. The XML file that we are going to query is:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="text-decoration: underline; font-weight: bold; color: rgb(0, 0, 255);"&gt;School.xml&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;?xml version="1.0"?&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;?xml-stylesheet type="text/xsl" href="Apply.xslt"?&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;School&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;title&amp;gt;The Xpath Exercise&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;people&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;teacher&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;FirstName&amp;gt;Henry&amp;lt;/FirstName&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;age&amp;gt;45&amp;lt;/age&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;description&amp;gt;Henry will be the tutor&amp;lt;/description&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;      &amp;lt;/teacher&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;      &amp;lt;student&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;FirstName&amp;gt;Jack&amp;lt;/FirstName&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;age&amp;gt;15&amp;lt;/age&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;description&amp;gt; is an American&amp;lt;/description&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;FoodPref picture="dolores_001.jpg"&amp;gt;Sea Food&amp;lt;/FoodPref&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/student&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;student&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;FirstName&amp;gt;Sorensen&amp;lt;/FirstName&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;age&amp;gt;16&amp;lt;/age&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;description&amp;gt; is a swedish&amp;lt;/description&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;/student&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;/people&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;furniture&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;chair&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;name&amp;gt;revolving chair&amp;lt;/name&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/chair&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;/furniture&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;/School&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So we have a direct child of  root element &amp;lt;School&amp;gt;. School has two  child elements called &amp;lt;people&amp;gt; and &amp;lt;furniture&amp;gt; People has child elements called teacher and student. Now we only want to show the students.Their first name and description.Here is the XSLT file that we are going to use.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="text-decoration: underline; font-weight: bold; color: rgb(0, 0, 255);"&gt;Apply.xslt&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;                 version="1.0"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;xsl:output method="html"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;xsl:template match="/School"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;html&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;body bgcolor="#FFFFFF"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;h1&amp;gt;What do we know about our students ?&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         Here are some information &amp;lt;ul&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;           &amp;lt;xsl:apply-templates select="people" /&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;/xsl:template&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;xsl:template match="people"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;           &amp;lt;xsl:apply-templates select="student"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;    &amp;lt;/xsl:template&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;xsl:template match="student"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;li&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;xsl:value-of select="FirstName"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;xsl:apply-templates select="description"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;/xsl:template&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;/xsl:stylesheet&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The syntax for locating the direct child t of root node is &lt;span style="font-weight: bold;"&gt;/XML_ElementName&lt;/span&gt;. Lets look at the beginning of  our first template.&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;xsl:template match="/School"&amp;gt;&lt;/span&gt;&lt;br /&gt;
 This defines the execution context of the template.It means the scope is the School element and the selection defined in this template will take effect on any school element in the output.&lt;br /&gt;
&lt;br /&gt;
Now comes the important part.&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;xsl:apply-templates select="people" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
This tells us that inside the school element, only the contents of the people element are going to be shown,so we are filtering out &amp;lt;furniture&amp;gt; here.&lt;br /&gt;
&lt;br /&gt;
In the next template, we are increasing the level of filtering. Here the context is defined as&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;xsl:template match="people"&amp;gt;&lt;/span&gt;.So this template is going to be applied on any people element in the output.So this is obviously going to be invoked by the first template call, as the first template is returning people element.The selection criteria here is &lt;br /&gt;
 &lt;span style="color: rgb(0, 0, 255);"&gt;  &amp;lt;xsl:apply-templates select="student"/&amp;gt;&lt;/span&gt;&lt;br /&gt;
So any people element will be showing ony the student elements inside it, leaving out the teacher element that we have.&lt;br /&gt;
&lt;br /&gt;
In the third step, we define a template for the student element itself. Till now all our endeavour was targeted at outputting a student element. So now we define how much information of the student we are going to show and how we want to show it. We want to show it as list elements.&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;xsl:apply-templates select="description"/&amp;gt;&lt;/span&gt;&lt;br /&gt;
So we want to show the description element of the student. We also want to show the value of the FirstName element.This can be done with .&lt;br /&gt;
 &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;xsl:value-of select="FirstName"/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So if you open the School.xml file the output you get should be:&lt;br /&gt;
&lt;br /&gt;
&lt;img height="161" width="560" alt="" src="/images/geekswithblogs_net/Shuvo/TanveerShuvo/XPath(1).JPG" /&gt; &lt;img src="http://geekswithblogs.net/Shuvo/aggbug/129486.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanveer-Ibn-Haresh</dc:creator>
            <guid>http://geekswithblogs.net/Shuvo/archive/2009/02/18/xpath-query.aspx</guid>
            <pubDate>Wed, 18 Feb 2009 18:39:32 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Shuvo/comments/129486.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Shuvo/archive/2009/02/18/xpath-query.aspx#feedback</comments>
            <slash:comments>33</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Shuvo/comments/commentRss/129486.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to refer a XSLT file in a XML Dcoment</title>
            <category>XML,XSLT,XPath</category>
            <link>http://geekswithblogs.net/Shuvo/archive/2009/02/17/how-to-refer-a-xslt-file-in-a-xml-dcoment.aspx</link>
            <description>Suppose You have a XML File Jungle.xml.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;project&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;title&amp;gt;The Xpath project&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;problems&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;problem&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;title&amp;gt;Initial problem&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;description&amp;gt;We have to learn something about Location Path&amp;lt;/description&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;difficulty level="5"&amp;gt;This problem should not be too hard&amp;lt;/difficulty&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/problem&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;solutions&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;item val="low"&amp;gt;Buy a XSLT book&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;item val="low"&amp;gt;Find an XSLT website&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;item val="high"&amp;gt;Register for a XSLT course and do exercices&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/solutions&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;problem&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;title&amp;gt;Next problem&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;description&amp;gt;We have to learn something about predicates&amp;lt;/description&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;difficulty level="6"&amp;gt;This problem is a bit more difficult&amp;lt;/difficulty&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/problem&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;solutions&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;item val="low"&amp;gt;Buy a XSLT book&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;item val="medium"&amp;gt;Read the specification and do some exercises&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;item val="high"&amp;gt;Register for a XPath course and do exercices&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/solutions&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;/problems&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;/project&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You have an XSLT file called Jungle.xslt file.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;                 version="1.0"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;xsl:output method="html"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;xsl:template match="/project"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;html&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;body bgcolor="#FFFFFF"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;h1&amp;gt;&amp;lt;xsl:value-of select="title" /&amp;gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         Here are the titles of our problems: &amp;lt;ul&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;xsl:apply-templates select="problems/problem" /&amp;gt; &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;       &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;/xsl:template&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;xsl:template match="problems/problem"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;   &amp;lt;li&amp;gt;&amp;lt;xsl:value-of select="title" /&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;/xsl:template&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;/xsl:stylesheet&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So how do you refer this xslt file in the xml file? Simple just add this one line under the &amp;lt;?xml version Tag just like this..&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;?xml-stylesheet type="text/xsl" href="Jungle.xslt"?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now Open the xml file in IE without this stylesheet reference added and with added.You will see the difference. &lt;img src="http://geekswithblogs.net/Shuvo/aggbug/129451.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanveer-Ibn-Haresh</dc:creator>
            <guid>http://geekswithblogs.net/Shuvo/archive/2009/02/17/how-to-refer-a-xslt-file-in-a-xml-dcoment.aspx</guid>
            <pubDate>Tue, 17 Feb 2009 17:46:17 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Shuvo/comments/129451.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Shuvo/archive/2009/02/17/how-to-refer-a-xslt-file-in-a-xml-dcoment.aspx#feedback</comments>
            <slash:comments>53</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Shuvo/comments/commentRss/129451.aspx</wfw:commentRss>
        </item>
        <item>
            <title>WPF Two way databinding explained</title>
            <category>WPF</category>
            <link>http://geekswithblogs.net/Shuvo/archive/2009/02/16/wpf-two-way-databinding-explained.aspx</link>
            <description>Many get confused over the two way databinding concept. This is usually  done by implementing INotiyPropertyChanged interface.You can find many examples with INotiyPropertyChanged if you google for it.  Here I am presenting a very basic example of WPF databinding to show its advantages. &lt;br /&gt;
&lt;br /&gt;
Create a WPF Application called "TwoWayDataBinding". You have app.xaml and Window1.xaml. Add one class called Customer to the project. The code for the class is bellow.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;using System;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System.Collections.Generic;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System.Linq;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System.Text;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; namespace TwoWayDataBind&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     class Customer&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         private string m_name; &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         public string Name&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             get { return m_name; }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             set { m_name = value; }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         private string m_State;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         public string State&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             get { return m_State; }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             set { m_State = value; }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We have two string  properties called  name and state in the customer class. We are going to use this class as the datasource for our  WPF form.&lt;br /&gt;
&lt;br /&gt;
Now look at the XAML code for the Window1.xaml file. The explanations will follow.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;Window x:Class="TwoWayDataBind.Window1"&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     xmlns:myapp="clr-namespace:TwoWayDataBind"&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     Title="Window1" Height="300" Width="300"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;Window.Resources&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;myapp:Customer x:Key="Cust2" Name="Hansen" State="Arizona"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/Window.Resources&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;Grid x:Name="Grid1"  DataContext="{StaticResource Cust2}"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;Grid.RowDefinitions&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             &amp;lt;RowDefinition Height="Auto"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             &amp;lt;RowDefinition Height="Auto"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             &amp;lt;RowDefinition Height="Auto"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;/Grid.RowDefinitions&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;Grid.ColumnDefinitions&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             &amp;lt;ColumnDefinition Width="Auto" /&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             &amp;lt;ColumnDefinition Width="*"/&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;/Grid.ColumnDefinitions&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;TextBlock Grid.Column="0" Grid.Row="0"&amp;gt;Name:&amp;lt;/TextBlock&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;TextBlock Grid.Column="0" Grid.Row="1"&amp;gt;State:&amp;lt;/TextBlock&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;TextBox x:Name="TextBox1" Grid.Column="1" Grid.Row="0" Text="{Binding Path=Name}"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;TextBox x:Name="TextBox2" Grid.Column="1" Grid.Row="1" Text="{Binding Path=State}"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;Button Grid.Column=" 1" Grid.Row="2"   Name="button1" Click="OnClicked"&amp;gt;Control To Context&amp;lt;/Button&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;        &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     &amp;lt;/Grid&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;/Window&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In the first  line the class Name for the Window1 form is specified.&lt;br /&gt;
&lt;br /&gt;
Next, there are two XML namespace declarations. The first declaration maps the overall  Windows Presentation Foundation (WPF) namespace as the default:&lt;br /&gt;
&lt;p&gt;The second declaration maps a separate Extensible Application Markup Language  (XAML) namespace, mapping it (typically) to the &lt;span&gt;&lt;span class="input"&gt;x:&lt;/span&gt;&lt;/span&gt; prefix. &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;Coming on to the next part, you can map XML namespaces to assemblies using a series of tokens within an  &lt;span&gt;&lt;span class="input"&gt;xmlns&lt;/span&gt;&lt;/span&gt; prefix declaration, similar to how  the standard WPF and XAML namespaces are mapped to prefixes.We are mapping a xml namespace myapp with the TwoWayDataBind Assembly . This will be  used in the next segment.&lt;/p&gt;
&lt;p&gt;In the next section,we are declaring a resource dictionary. Microsoft defines these dictionaries as "Resource dictionaries that can be defined completely or partially in Extensible  Application Markup Language (XAML) are typically created as a property element,  and are typically on the root element for any individual page or for the  application. Placing the resource dictionary at this level makes it easier to  find from individual child elements in the page (or from any page, in the  application case)". We are declaring a resource for  window element, so that all child elements of the window can access it. You can also define resources for page,grid and other elements. We used the xml namespace myapp, that we mapped to our application assembly section. We are accesing the customer class of the TwoWayBindingAssmbly with myapp:Customer. We are defining a key for the resource, which will be used for accessing it from other elements in the form. We are also specifying values for the two customer properties.&lt;/p&gt;
&lt;p&gt;Next we define the grid element for the WPF form. Look at the part  DataContext="{StaticResource Cust2}. This is the important part for defining the databinding for our form. DataContext is a dependency property. It gets or sets the data context for an element when it participates in data  binding. So are defining a datacontext for the Grid element here.We are defining the datacontext using the StaticResource. Static Resource provides a value for any XAML property attribute by looking up a reference to an  already defined resource. That defined resource here is obviously Cust2, which is nothing but our customer class.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;The Next 11 lines defines the form design xaml, as any wpf developer would find it  easy to understand. Coming to the part of our interest :&lt;/p&gt;
&lt;p&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt; &amp;lt;TextBox x:Name="TextBox1" Grid.Column="1" Grid.Row="0" Text="{Binding Path=Name}"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         &amp;lt;TextBox x:Name="TextBox2" Grid.Column="1" Grid.Row="1" Text="{Binding Path=State}"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;   Here we are binding the text properties of the text boxes to the properties of the customer class. MSDN describes WPF databinding as "&lt;br /&gt;
&lt;/p&gt;
&lt;div class="ArticleNormalPara"&gt;To use WPF data &lt;font color="#ffffff" style="background-color: rgb(49, 106, 197);"&gt;binding&lt;/font&gt;, you must always  have a target and a source. The target of the &lt;font color="#ffffff" style="background-color: rgb(49, 106, 197);"&gt;binding&lt;/font&gt; can be any  accessible property or element that is derived from DependencyProperty—an  example is a TextBox control's Text property. The source of the &lt;font color="#ffffff" style="background-color: rgb(49, 106, 197);"&gt;binding&lt;/font&gt; can be any public  property, including properties of other controls, common language runtime (CLR)  objects, XAML elements, ADO.NET DataSets, XML Fragments, and so forth. To help  you get the &lt;font color="#ffffff" style="background-color: rgb(49, 106, 197);"&gt;binding&lt;/font&gt;  right, WPF includes two special providers—the XmlDataProvider and the  ObjectDataProvider."&lt;br /&gt;
&lt;br /&gt;
The syntax we are using here is called attribute syntax. It condenses the data &lt;font color="#ffffff" style="background-color: rgb(49, 106, 197);"&gt;binding&lt;/font&gt; code inside of the Text attribute of the TextBox.  Basically, the &lt;font color="#ffffff" style="background-color: rgb(49, 106, 197);"&gt;Binding&lt;/font&gt; tag gets pulled inside of the curly braces along  with its attributes. "Path" is one of the Four components of Binding class. It gets or sets the path to the binding source property.  So here we are setting the two properties of  the customer class the the Binding source property of the textbox's text propety.&lt;br /&gt;
&lt;br /&gt;
We have a button on the form and it has a click event method defined. Here is the code for the codebehind for the form.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="text-decoration: underline; color: rgb(0, 0, 255); font-weight: bold;"&gt;Window1.xaml.cs&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System.Collections.Generic;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System.Linq;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System.Text;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System.Windows;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; using System.Windows.Data;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; namespace TwoWayDataBind&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     /// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     /// Interaction logic for Window1.xaml&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     public partial class Window1 : Window&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         public Window1()&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             InitializeComponent();&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         private void OnClicked(object sender, RoutedEventArgs args)&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             Customer c1=Grid1.DataContext as Customer;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;            &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             TextBox1.Text = c1.State;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;        &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now if you run the project  you will see.&lt;br /&gt;
&lt;img height="304" width="307" alt="" src="/images/geekswithblogs_net/Shuvo/TanveerShuvo/WPF.jpg" /&gt;&lt;br /&gt;
&lt;br /&gt;
So the textbox's are bound to the customer properties. We can see the values of the customer object in the texboxes.So this is one side of the databinding...the target object is getting update by the value of the data source. Now write something in the state textbox and click the button. What do you see? The Name textbox getting populated with the value of the State textBox.&lt;br /&gt;
&lt;br /&gt;
If we look at the code for the button click:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;Customer c1=Grid1.DataContext as Customer;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;  TextBox1.Text = c1.State;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We are not assigning the new value to the customer class or datacontext. As we type  in the State textbox, the dataContext  is getting updated. So when we assign the datacontext's State value to the Name textbox, we see it gets populated with the new value that is entered. Isn't it just fantastic?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/Shuvo/aggbug/129425.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanveer-Ibn-Haresh</dc:creator>
            <guid>http://geekswithblogs.net/Shuvo/archive/2009/02/16/wpf-two-way-databinding-explained.aspx</guid>
            <pubDate>Mon, 16 Feb 2009 18:14:01 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Shuvo/comments/129425.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Shuvo/archive/2009/02/16/wpf-two-way-databinding-explained.aspx#feedback</comments>
            <slash:comments>42</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Shuvo/comments/commentRss/129425.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Your First Simple Basic Asp.net Workflow</title>
            <link>http://geekswithblogs.net/Shuvo/archive/2009/02/09/your-first-simple-basic-asp.net-workflow.aspx</link>
            <description>When I tried to jump into the asp.net workflow platform, I found out there are really very few simple/basic examples available in the internet. Most articles deal with huge business concepts,utilizing different workflowservices, that can be really confusing for someone new to workflow development.Here I have tried a simple hello world Type of Asp.net Workflow..this is not bad for a startup.&lt;br /&gt;
&lt;br /&gt;
The concept is really simple.You have a webpage default.aspx , with a textbox and a button. You enter an amount in the textbox and if the amount is more than 100, you are redirected to the credit.aspx and if less, to the debit.aspx. To start, Place the code from my previous &lt;a href="http://geekswithblogs.net/Shuvo/archive/2009/02/04/making-sure-workflow-runtime-has-a-single-instance-in-the.aspx"&gt;post&lt;/a&gt;, into the application_start and application_end section of  your Global.asax page.&lt;br /&gt;
&lt;br /&gt;
Add a sequential workflowLibrary  project to your solution.(my one is named workflowLibrary2).You see there is a sequential workflow  workflow1 added to the project. Drop a ifElseActivity from the Toolbox. &lt;br /&gt;
&lt;img height="317" width="493" src="/images/geekswithblogs_net/Shuvo/TanveerShuvo/WWF.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
Now in the left ifElseactivity, set the condition property as codecondition and define the condition as ValidateAmount.Double clicking it will take you the codebehind for the workflow1.cs.Place 2 codeactivity objects on both the branches. I will come back to this later.&lt;br /&gt;
&lt;br /&gt;
Now on the codebehind section of the workflow1.cs, rightclick--&amp;gt;insertsnippet--&amp;gt;other--&amp;gt;workflow--&amp;gt;WorkflowDependencyProperty. Like this you make two properties like below.&lt;br /&gt;
&lt;br /&gt;
 &lt;span style="color: rgb(0, 0, 255);"&gt;public static DependencyProperty AmountProperty = DependencyProperty.Register("Amount", typeof(Int32), typeof(Workflow1));&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         [DescriptionAttribute("Amount")]&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         [CategoryAttribute("Amount Category")]&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         [BrowsableAttribute(true)]&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         public Int32 Amount&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             get&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;                 return ((Int32)(base.GetValue(Workflow1.AmountProperty)));&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             set&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;                 base.SetValue(Workflow1.AmountProperty, value);&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         public static DependencyProperty ResultProperty = DependencyProperty.Register("Result", typeof(string), typeof(Workflow1));&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         [DescriptionAttribute("Result")]&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         [CategoryAttribute("Result Category")]&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         [BrowsableAttribute(true)]&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         public string Result&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             get&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;                 return ((string)(base.GetValue(Workflow1.ResultProperty)));&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             set&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;                 base.SetValue(Workflow1.ResultProperty, value);&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br /&gt;
The first property is integer and the second one string.&lt;br /&gt;
&lt;br /&gt;
Now come back to the ifElseActivity Condition. We are just going to check if the amount entered is more than 100.&lt;br /&gt;
&lt;br /&gt;
 &lt;span style="color: rgb(0, 0, 255);"&gt;private void ValidateAmount(object sender, ConditionalEventArgs e)&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             if (this.Amount &amp;gt; 100)&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;                 e.Result = true;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br /&gt;
The conditionaleventArg e is evaluated here. If the condition is satisfied assign e.Result as true, so the activity associated with it will be executed. No condition is specified for the other branch, so it will just act as an else clause. Now define ExecuteCode property of the CodeActivity objects by  selecting  the ExecuteCode property, writing down the name of the method for it and doubleClicking it. For CodeActivity1 I am writing RedirectCredit and for CodeActivity2  RedirectDebit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;span style="color: rgb(0, 0, 255);"&gt; private void RedirectCredit(object sender, EventArgs e)&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             this.Result = "Credit.aspx";&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         private void RedirectDebit(object sender, EventArgs e)&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;             this.Result = "Debit.aspx";&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The two dependency properties that  I defined above are going to be used as parameters of the workflow. The easiest and simple way to pass parameters between the WorkFlow host application and the Workflow instance is to use Dictionary Objects collection. I am going to show how in the next section.&lt;br /&gt;
&lt;br /&gt;
In the codebehind of the Default.aspx write code for the Button click event.&lt;br /&gt;
&lt;br /&gt;
 &lt;span style="color: rgb(0, 0, 255);"&gt;protected void Button1_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         InitiateWorkFlow();&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     }&lt;/span&gt;&lt;br /&gt;
Define the InitiateWorkFlow method.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;private void InitiateWorkFlow()&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         Dictionary&amp;lt;string, object&amp;gt; parameters = new Dictionary&amp;lt;string, object&amp;gt;();&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         parameters.Add("Amount",Convert.ToInt32(TextBox1.Text));&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         parameters.Add("Result", "");&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         WorkflowRuntime wfRuntime = Application["WorkflowRuntime"] as System.Workflow.Runtime.WorkflowRuntime;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         wfRuntime.WorkflowCompleted += new EventHandler&amp;lt;WorkflowCompletedEventArgs&amp;gt;(wfRuntime_WorkflowCompleted);&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         WorkflowInstance wi = wfRuntime.CreateWorkflow(typeof(WorkflowLibrary2.Workflow1), parameters);&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         wi.Start();&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         ManualWorkflowSchedulerService ss = wfRuntime.GetService&amp;lt;ManualWorkflowSchedulerService&amp;gt;();&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         ss.RunWorkflow(wi.InstanceId);&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         //HttpContext.Current.Session["WorkflowID"] = wi.InstanceId;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     }&lt;/span&gt;&lt;br /&gt;
Lets describe it. First we declare a Dictionary collection object  'parameters'. This is the parameter object that the host is going to use to pass on to the workflow. I add two parameters amount and result, to the collection.Then I declare a WorkflowRuntime Object and load it with the runtime object from the application object, that was created in the application_Start  event. I am also adding an eventhander for the WorkflowCompleted Event.Then the WorkFlowInstance is created and look how the parameters object is passed on to it in the CreateWorkflow method. The 2 params created here will be mapped on to the Dependency properties in the workFlow. Then the workflow instance is started.&lt;br /&gt;
&lt;br /&gt;
Next, remember the   ManualWorkflowSchedulerService that we added to the WF Runtim, in the Application_start event. We retrieve that   ManualWorkflowSchedulerService by using the GetSerive method of the wfRuntime object. Then we execute the RunWorkFlow method of the   ManualWorkflowSchedulerService. We are doing this because this will use the delayactivity built in this newly developed   ManualWorkflowSchedulerService, so that once the host thread starts executing, it will stop for the workFlow thread to finish executing and resume itself again. This is synchronized execution of both the Host request and workflow runtime on the same thread.&lt;br /&gt;
&lt;br /&gt;
Next we describe the WorkFlowCompleted Event.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt; static void wfRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     {&lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;         HttpContext.Current.Response.Redirect((string)e.OutputParameters["Result"]);   &lt;/span&gt;&lt;br style="color: rgb(0, 0, 255);" /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;     }&lt;/span&gt;&lt;br /&gt;
In this method, observe that the eventArgument is called WorkflowCompletedEventArgs. This argument e has a collection called Outputparametes which holds the Workflow paramater collection. So we can retrieve the value of the WorkFlow Parameter  'Result' and use it for our redirection of page. &lt;img src="http://geekswithblogs.net/Shuvo/aggbug/129288.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanveer-Ibn-Haresh</dc:creator>
            <guid>http://geekswithblogs.net/Shuvo/archive/2009/02/09/your-first-simple-basic-asp.net-workflow.aspx</guid>
            <pubDate>Mon, 09 Feb 2009 18:54:21 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Shuvo/comments/129288.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Shuvo/archive/2009/02/09/your-first-simple-basic-asp.net-workflow.aspx#feedback</comments>
            <slash:comments>416</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Shuvo/comments/commentRss/129288.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Making sure Workflow Runtime has a single instance in the WebApplication Runtime</title>
            <category>WorkFlow</category>
            <link>http://geekswithblogs.net/Shuvo/archive/2009/02/04/making-sure-workflow-runtime-has-a-single-instance-in-the.aspx</link>
            <description>Source Code:MSDN&lt;br /&gt;
In previous versions, application used to get reference to Current workflowrutime by using codes like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;WorkflowRuntime workflowRuntime=WorkflowRequest.Current.WorkflowRuntime;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
But with 3.5 web applications use application object to store the workflowRuntime when the application starts and disposes of the runtime instance when the application stops. Global.asax file is used to hook the application_start and Application_End Event.&lt;br /&gt;
&lt;br /&gt;
Here is how it is done:&lt;br /&gt;
&lt;br /&gt;
void Application_Start(object sender, EventArgs e) &lt;br /&gt;
{&lt;br /&gt;
    System.Workflow.Runtime.WorkflowRuntime workflowRuntime =&lt;br /&gt;
        new System.Workflow.Runtime.WorkflowRuntime();&lt;br /&gt;
&lt;br /&gt;
    System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService manualService =&lt;br /&gt;
        new System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService();&lt;br /&gt;
    workflowRuntime.AddService(manualService);&lt;br /&gt;
    &lt;br /&gt;
    workflowRuntime.StartRuntime();&lt;br /&gt;
&lt;br /&gt;
    Application["WorkflowRuntime"] = workflowRuntime;           &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Application_End(object sender, EventArgs e) &lt;br /&gt;
{&lt;br /&gt;
    System.Workflow.Runtime.WorkflowRuntime workflowRuntime =&lt;br /&gt;
        Application["WorkflowRuntime"] as System.Workflow.Runtime.WorkflowRuntime;&lt;br /&gt;
    workflowRuntime.StopRuntime();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
This workFlowRuntime instance remains in the application object as long as the webapplication handles requests.&lt;br /&gt;
Here is how you can how to retrieve this workflow runtime instance from the application object and star a workflow successfully. &lt;br /&gt;
&lt;br /&gt;
protected void StartRuntime_Click(object sender, EventArgs e)&lt;br /&gt;
{&lt;br /&gt;
    WorkflowRuntime workflowRuntime = Application["WorkflowRuntime"] as WorkflowRuntime;&lt;br /&gt;
    ManualWorkflowSchedulerService manualScheduler = &lt;br /&gt;
        workflowRuntime.GetService(typeof(ManualWorkflowSchedulerService)) &lt;br /&gt;
        as ManualWorkflowSchedulerService;&lt;br /&gt;
&lt;br /&gt;
    WorkflowInstance instance = workflowRuntime.CreateWorkflow(&lt;br /&gt;
        typeof(ASPNetSequentialWorkflow));&lt;br /&gt;
    instance.Start();&lt;br /&gt;
    manualScheduler.RunWorkflow(instance.InstanceId);&lt;br /&gt;
} &lt;img src="http://geekswithblogs.net/Shuvo/aggbug/129183.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Shuvo</dc:creator>
            <guid>http://geekswithblogs.net/Shuvo/archive/2009/02/04/making-sure-workflow-runtime-has-a-single-instance-in-the.aspx</guid>
            <pubDate>Wed, 04 Feb 2009 18:49:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Shuvo/comments/129183.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Shuvo/archive/2009/02/04/making-sure-workflow-runtime-has-a-single-instance-in-the.aspx#feedback</comments>
            <slash:comments>39</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Shuvo/comments/commentRss/129183.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Workflow Essentials</title>
            <category>WorkFlow</category>
            <link>http://geekswithblogs.net/Shuvo/archive/2009/02/03/workflow-essentials.aspx</link>
            <description>Source: MSDN&lt;br /&gt;
Things you should know before working on Workflow.&lt;br /&gt;
&lt;br /&gt;
***   A workflow built on Windows Workflow Foundation is a component that requires an  ad hoc runtime environment to function. The workflow runtime environment is  represented by the WorkflowRuntime class. To host a workflow library, you create  and configure an instance of the WorkflowRuntime class to operate on a  particular workflow type. For performance reasons, you normally create the  runtime environment only once in the application lifetime and make it serve all  incoming requests. In a Windows Forms application, you initialize the workflow  runtime in the form's constructor and destroy it with the form when the  application shuts down. &lt;img src="http://geekswithblogs.net/Shuvo/aggbug/129165.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Shuvo</dc:creator>
            <guid>http://geekswithblogs.net/Shuvo/archive/2009/02/03/workflow-essentials.aspx</guid>
            <pubDate>Tue, 03 Feb 2009 18:59:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Shuvo/comments/129165.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Shuvo/archive/2009/02/03/workflow-essentials.aspx#feedback</comments>
            <slash:comments>9</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Shuvo/comments/commentRss/129165.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
