<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Kathy Kam : Code samples</title><link>http://blogs.msdn.com/kathykam/archive/tags/Code+samples/default.aspx</link><description>Tags: Code samples</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>WatermarkedTextBox for Silverlight 2 Beta 2</title><link>http://blogs.msdn.com/kathykam/archive/2008/06/23/watermarkedtextbox-for-silverlight-2-beta-2.aspx</link><pubDate>Tue, 24 Jun 2008 04:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8644853</guid><dc:creator>KathyKam</dc:creator><slash:comments>32</slash:comments><comments>http://blogs.msdn.com/kathykam/comments/8644853.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kathykam/commentrss.aspx?PostID=8644853</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kathykam/rsscomments.aspx?PostID=8644853</wfw:comment><description>&lt;P mce_keep="true"&gt;One breaking change you may have noticed between Silverlight 2 Beta 1 and Beta 2 is that &lt;STRONG&gt;WatermarkedTextBox&lt;/STRONG&gt; is no longer available in the Silverlight SDK (System.Windows.Controls.Extended.dll).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;We decided to remove the control because in a future version of Silverlight, we will be adding a “Watermark” property to TextBox. Given this upcoming change, it does not make sense to have "WatermarkedTextBox" as a separate control, so we decided to remove the control from Silverlight 2.&lt;/P&gt;
&lt;P&gt;Because the update to TextBox will not happen until a future version of Silverlight feel free download and use the &lt;A href="http://kkam.members.winisp.net/projects/watermarkedtextbox.zip" mce_href="http://kkam.members.winisp.net/projects/watermarkedtextbox.zip"&gt;WatermarkedTextBox source code and unit test&lt;/A&gt; in the mean time. By downloading the source and unit tests you accept the &lt;A href="http://go.microsoft.com/fwlink/?LinkID=111970&amp;amp;clcid=0x409" mce_href="http://go.microsoft.com/fwlink/?LinkID=111970&amp;amp;clcid=0x409"&gt;license&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here is an example on how to use it:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2WatermarkedTextBox_100AD/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2WatermarkedTextBox_100AD/image_8.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=187 alt=image src="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2WatermarkedTextBox_100AD/image_thumb_3.png" width=845 border=0 mce_src="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2WatermarkedTextBox_100AD/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2WatermarkedTextBox_100AD/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2WatermarkedTextBox_100AD/image_6.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=91 alt=image src="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2WatermarkedTextBox_100AD/image_thumb_2.png" width=488 border=0 mce_src="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2WatermarkedTextBox_100AD/image_thumb_2.png"&gt;&lt;/A&gt; &lt;BR&gt;
&lt;P mce_keep="true"&gt;For more information on how to use this control, check out our Beta1&amp;nbsp;documentation in MSDN:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.watermarkedtextbox(VS.95).aspx"&gt;http://msdn.microsoft.com/en-us/library/system.windows.controls.watermarkedtextbox(VS.95).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In additional to&amp;nbsp;porting&amp;nbsp;the source code &amp;amp;&amp;nbsp;unit test for Beta 1, we also&amp;nbsp;did the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Updated the template to use new features in the framework (i.e. VisualStateManager)&lt;/LI&gt;
&lt;LI&gt;Bug fixing: When the control has focus, MouseOver state will no longer be active after moving the mouse away from the cotnrol&lt;/LI&gt;
&lt;LI&gt;Bug fixing: Allow&amp;nbsp;setting BorderBrush correctly&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you run into any problems, let me know! :)&lt;/P&gt;
&lt;P&gt;&amp;lt;Editorial Note&amp;gt;&lt;BR&gt;This is also a great example on how to use the new Visual State Manager for Silverlight 2 Beta 2! &lt;BR&gt;Also a special "Thank you" to the WatermarkedTextBox dev Alex Bulankou for porting the source code, updating &amp;amp; fixing the bugs.&lt;BR&gt;&amp;lt;/Editorial Note&amp;gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8644853" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kathykam/archive/tags/Code+samples/default.aspx">Code samples</category><category domain="http://blogs.msdn.com/kathykam/archive/tags/Silverlight+Controls/default.aspx">Silverlight Controls</category></item><item><title>Silverlight 2 Beta 2 has shipped!</title><link>http://blogs.msdn.com/kathykam/archive/2008/06/06/silverlight-2-beta-2-has-shipped.aspx</link><pubDate>Sat, 07 Jun 2008 07:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8579509</guid><dc:creator>KathyKam</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/kathykam/comments/8579509.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kathykam/commentrss.aspx?PostID=8579509</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kathykam/rsscomments.aspx?PostID=8579509</wfw:comment><description>&lt;P&gt;Just a few hours ago, I was doing my talk based on Silverlight 2 Beta 2 bits and one of my attendee asked about when Beta 2 will be available. I am happy to annouce that it is now available!&lt;/P&gt;
&lt;P mce_keep="true"&gt;Download the bits now on &lt;A class="" href="http://silverlight.net/GetStarted/" mce_href="http://silverlight.net/GetStarted/"&gt;Silverlight.Net&lt;/A&gt;!&lt;/P&gt;
&lt;P mce_keep="true"&gt;I have also updated my controls sample for Beta 2. I've made some significant changes and I hope you like it! :)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2hasshipped_13536/clip_image001_2.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 0px 15px 0px 0px; BORDER-RIGHT-WIDTH: 0px" height=157 alt=clip_image001 src="http://blogs.msdn.com/blogfiles/kathykam/WindowsLiveWriter/Silverlight2Beta2hasshipped_13536/clip_image001_thumb.jpg" width=244 align=left border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://silverlight.net/Samples/2b2/SilverlightControls/run/default.html" mce_href="http://silverlight.net/Samples/2b2/SilverlightControls/run/default.html"&gt;Silverlight Control Demo Sample&lt;/A&gt; &lt;BR&gt;Uploaded on June 4 &lt;BR&gt;&lt;EM&gt;Created by:&lt;/EM&gt; Microsoft &lt;/P&gt;
&lt;P&gt;A sample of twenty-four Silverlight 2 controls that can be viewed live together with the source code used to drive the controls. &lt;/P&gt;
&lt;P&gt;By clicking Download It you accept the &lt;A href="http://go.microsoft.com/fwlink/?LinkID=111970&amp;amp;clcid=0x409"&gt;license&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://silverlight.net/Samples/2b2/SilverlightControls/SilverlightControls.zip"&gt;&lt;B&gt;&lt;/B&gt;&lt;/A&gt;&lt;A class="" href="http://silverlight.net/Samples/2b2/SilverlightControls/run/default.html" mce_href="http://silverlight.net/Samples/2b2/SilverlightControls/run/default.html"&gt;&lt;IMG alt="View It" src="http://silverlight.net/Themes/silverlight/images/gallery/button_view.gif" border=0&gt;&lt;/A&gt;&lt;A class="" href="http://silverlight.net/Samples/2b2/SilverlightControls/SilverlightControls.zip" mce_href="http://silverlight.net/Samples/2b2/SilverlightControls/SilverlightControls.zip"&gt;&lt;IMG height=30 alt="Download It" src="http://silverlight.net/Themes/silverlight/images/gallery/button_download.gif" width=105 border=0&gt;&lt;/A&gt;&lt;/A&gt;&lt;/A&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I'm always interested to hear feedback, so remember to leave a comment and let me know what you think about the controls and the sample! &lt;/P&gt;
&lt;P&gt;&amp;lt;Editorial Note&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;The links to my sample is broken on Silverlight.NET . I have contacted the owners of the page to see what's wrong. In the mean time, I have uploaded it on my WINISP account and set the links above to it. I'll update this blog once the links are fixed.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;Links on Silverlight.Net is now fixed! Woohoo!&lt;/P&gt;
&lt;P&gt;&amp;lt;/Editorial Note&amp;gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8579509" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kathykam/archive/tags/Code+samples/default.aspx">Code samples</category><category domain="http://blogs.msdn.com/kathykam/archive/tags/Silverlight+Controls/default.aspx">Silverlight Controls</category></item><item><title>Silverlight 2 Beta 1 Control Samples</title><link>http://blogs.msdn.com/kathykam/archive/2008/03/05/silverlight-2-beta-1-control-samples.aspx</link><pubDate>Thu, 06 Mar 2008 00:54:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8056395</guid><dc:creator>KathyKam</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/kathykam/comments/8056395.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kathykam/commentrss.aspx?PostID=8056395</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kathykam/rsscomments.aspx?PostID=8056395</wfw:comment><description>&lt;p&gt;My sample and its source is now live on &lt;a href="http://silverlight.net"&gt;http://silverlight.net&lt;/a&gt;! It show case a variety of controls we have built for the Silverlight 2 Beta 1. We have quite an good set of controls. It shouldn't surprise my readers to know that we have a DatePicker and a Calendar. :) And yes, I am the PM for those features. So for those of you who are sick of using my &lt;a href="http://blogs.msdn.com/kathykam/archive/2007/11/06/monthcalendar-and-datepicker-control-for-silverlight.aspx"&gt;Silverlight 1.1 Calendar/DatePicker&lt;/a&gt;. Pick up the latest &lt;a href="http://www.microsoft.com/silverlight/resources/installationFiles.aspx?v=2.0"&gt;Silverlight 2 Beta 1&lt;/a&gt;! &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img height="172" alt="" src="http://silverlight.net/Themes/silverlight/images/learn/controls.png" width="269" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.net/Samples/2b1/SilverlightControls/run/default.html"&gt;Silverlight Control Demo Sample&lt;/a&gt;     &lt;br /&gt;Uploaded on March 5     &lt;br /&gt;&lt;em&gt;Created by:&lt;/em&gt; &lt;a href="http://blogs.msdn.com/kathykam/"&gt;Kathy Kam&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A sample of twenty-four Silverlight 2 controls that can be viewed live together with the source code used to drive the controls. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Check out other samples here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://silverlight.net/community/gallerydetail.aspx?cat=5&amp;amp;sort=1#vid1080" href="http://silverlight.net/community/gallerydetail.aspx?cat=5&amp;amp;sort=1#vid1080"&gt;http://silverlight.net/community/gallerydetail.aspx?cat=5&amp;amp;sort=1#vid1080&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Also, as mentioned by ScottGu this morning. You can download the source and unit tests to all the controls here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ea93dd89-3af2-4acb-9cf4-bfe01b3f02d4&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=ea93dd89-3af2-4acb-9cf4-bfe01b3f02d4&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Love to hear what you think! I am excited to see applications people build with these controls. Tell me what you are building!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8056395" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kathykam/archive/tags/Code+samples/default.aspx">Code samples</category><category domain="http://blogs.msdn.com/kathykam/archive/tags/Silverlight+Controls/default.aspx">Silverlight Controls</category></item><item><title>MonthCalendar and Datepicker control for Silverlight</title><link>http://blogs.msdn.com/kathykam/archive/2007/11/06/monthcalendar-and-datepicker-control-for-silverlight.aspx</link><pubDate>Wed, 07 Nov 2007 04:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5948643</guid><dc:creator>KathyKam</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/kathykam/comments/5948643.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kathykam/commentrss.aspx?PostID=5948643</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kathykam/rsscomments.aspx?PostID=5948643</wfw:comment><description>&lt;P&gt;In my spare time, I wrote a MonthCalendar and DatePicker control for &lt;A class="" href="http://silverlight.net/" mce_href="http://Silverlight.net"&gt;Silverlight&lt;/A&gt;. It was just a side project for me to learn Silverlight. &lt;/P&gt;
&lt;P&gt;My MonthCalendar and DatePicker can be downloaded &lt;A class="" href="http://kkam.members.winisp.net/projects/monthcalendar.zip" mce_href="http://kkam.members.winisp.net/projects/monthcalendar.zip"&gt;here&lt;/A&gt;. The sample&amp;nbsp;works with Silverlight 1.1 RC Alpha Refresh (Sept 2007) that can be downloaded &lt;A class="" href="http://www.microsoft.com/silverlight/install.aspx" mce_href="http://www.microsoft.com/silverlight/install.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Please note that the code&amp;nbsp;snippet is provided under the &lt;A class="" href="http://www.microsoft.com/resources/sharedsource/licensingbasics/permissivelicense.mspx" mce_href="http://www.microsoft.com/resources/sharedsource/licensingbasics/permissivelicense.mspx"&gt;Microsoft Permissive Liceanse&lt;/A&gt;, and I provide it "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.&lt;/P&gt;
&lt;P&gt;If you actually use it.. I'll be interested to know where and how! :)&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://kkam.members.winisp.net/Pictures/MonthCalendar.jpg" mce_src="http://kkam.members.winisp.net/Pictures/MonthCalendar.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5948643" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kathykam/archive/tags/Code+samples/default.aspx">Code samples</category><category domain="http://blogs.msdn.com/kathykam/archive/tags/Silverlight+Controls/default.aspx">Silverlight Controls</category></item><item><title>TxRef update</title><link>http://blogs.msdn.com/kathykam/archive/2005/11/16/493685.aspx</link><pubDate>Thu, 17 Nov 2005 02:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:493685</guid><dc:creator>KathyKam</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/kathykam/comments/493685.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kathykam/commentrss.aspx?PostID=493685</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kathykam/rsscomments.aspx?PostID=493685</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT face=Tahoma&gt;If you opened up your CD from &lt;A href="/kcwalina/"&gt;Kr&lt;/A&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&lt;FONT face=Tahoma&gt;&lt;A href="/kcwalina/"&gt;zysztof Cwalina &lt;/A&gt;and &lt;A href="/brada"&gt;Brad Abram's &lt;/A&gt;new book &lt;A href="http://www.amazon.com/gp/product/0321246756/103-2042416-2375826?v=glance&amp;amp;n=283155&amp;amp;n=507846&amp;amp;s=books&amp;amp;v=glance"&gt;Framework Design Guidelines&lt;/A&gt;. You will notice a nifty tool named TxRef. Unfortunately, the tool was written against "Whibey Beta", and some code needs to be updated for "Whidbey RTM". &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;Here is the updated code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; WriteTypeConstraints(Type type)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (Type t &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; type.GetGenericArguments())&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt; writeComma = &lt;SPAN style="COLOR: maroon"&gt;false&lt;/SPAN&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type[] arr = t.GetGenericParameterConstraints();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GenericParameterAttributes ga = t.GenericParameterAttributes &amp;amp; GenericParameterAttributes.SpecialConstraintMask;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; ((arr.Length &amp;gt; &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt;) || (ga != GenericParameterAttributes.None))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write(&lt;SPAN style="COLOR: maroon"&gt;" where "&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteTypeName(t);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write(&lt;SPAN style="COLOR: maroon"&gt;":"&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; i = &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt;; i &amp;lt; arr.Length; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteTypeName(arr[i]);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (i &amp;lt; arr.Length - &lt;SPAN style="COLOR: maroon"&gt;1&lt;/SPAN&gt;) Write(&lt;SPAN style="COLOR: maroon"&gt;","&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=#0000ff&gt;&amp;nbsp;if&lt;/FONT&gt; (arr.Length &amp;gt; 0)&amp;nbsp; writeComma = &lt;SPAN style="COLOR: maroon"&gt;true&lt;/SPAN&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; ((ga &amp;amp; GenericParameterAttributes.ReferenceTypeConstraint) != &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (writeComma) Write(&lt;SPAN style="COLOR: maroon"&gt;", "&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write(&lt;SPAN style="COLOR: maroon"&gt;"class"&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writeComma = &lt;SPAN style="COLOR: maroon"&gt;true&lt;/SPAN&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; ((ga &amp;amp; GenericParameterAttributes.NotNullableValueTypeConstraint) != &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (writeComma) Write(&lt;SPAN style="COLOR: maroon"&gt;", "&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write(&lt;SPAN style="COLOR: maroon"&gt;"struct"&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writeComma = &lt;SPAN style="COLOR: maroon"&gt;true&lt;/SPAN&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#000080&gt;else &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; &lt;/FONT&gt;((ga &amp;amp; GenericParameterAttributes.DefaultConstructorConstraint) != &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (writeComma) Write(&lt;SPAN style="COLOR: maroon"&gt;", "&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write(&lt;SPAN style="COLOR: maroon"&gt;"new()"&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;Brad also talked about this particular breaking change in his blog &lt;A href="/brada/archive/2004/10/04/237908.aspx"&gt;here&lt;/A&gt;. I want to personally thank &lt;A href="http://www.thezbuffer.com"&gt;Andy &lt;/A&gt;for finding and reporting this error.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=493685" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kathykam/archive/tags/Code+samples/default.aspx">Code samples</category></item><item><title>Augmenting to the Good For Nothing Compiler (Part 1 of 2)</title><link>http://blogs.msdn.com/kathykam/archive/2005/10/17/482091.aspx</link><pubDate>Tue, 18 Oct 2005 04:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:482091</guid><dc:creator>KathyKam</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/kathykam/comments/482091.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kathykam/commentrss.aspx?PostID=482091</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kathykam/rsscomments.aspx?PostID=482091</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;A little while back, Joel posted the source to the &lt;A href="/joelpob/archive/2005/10/04/476965.aspx"&gt;Good For Nothing (GFN) Compiler &lt;/A&gt;and wondered what people can do with it. As a little side project, I added some features to the&amp;nbsp;GFN Compiler&amp;nbsp;which I will post in two parts. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Part 1: Making BCL calls from the GFN Compiler&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Part 2: Making Function calls from the GFN Compiler&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;And without further ado.. here is part 1...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;STRONG&gt;Part 1: Making BCL calls from the GFN Compiler&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Here is the grammar modification I did to accomodate making BCL calls:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;&amp;lt;stmt&amp;gt; := var &amp;lt;ident&amp;gt; = &amp;lt;expr&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| &amp;lt;ident&amp;gt; = &amp;lt;expr&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| &amp;lt;ident&amp;gt; = &amp;lt;func_stmt&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| for &amp;lt;ident&amp;gt; = &amp;lt;expr&amp;gt; to &amp;lt;expr&amp;gt; do &amp;lt;stmt&amp;gt; end&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| read_int &amp;lt;ident&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| print &amp;lt;expr&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| &amp;lt;stmt&amp;gt; ; &amp;lt;stmt&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| &amp;lt;func_stmt&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT size=2&gt;&lt;FONT color=#ff0000 size=2&gt;&amp;lt;func_stmt&amp;gt; := &amp;lt;scope&amp;gt;&amp;lt;func_call&amp;gt;&lt;BR&gt;&amp;lt;scope&amp;gt; := (&amp;lt;namespace&amp;gt;)? &amp;lt;scope&amp;gt;*&lt;BR&gt;&amp;lt;namespace&amp;gt; := &amp;lt;ident&amp;gt;.&lt;BR&gt;&amp;lt;func_call&amp;gt; := &amp;lt;ident&amp;gt; (&amp;lt;args&amp;gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;&lt;STRONG&gt;Additons to scanner.cs for class Scanner:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face=Verdana color=#000000&gt;First, I need to scan the new objects for a function call into the tokens. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;// Constants to represent arithmitic tokens. This could&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// be alternatively written as an enum.&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;// ....&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;readonly&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;FONT color=#000000&gt;Comma&lt;/FONT&gt; = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;();&lt;/FONT&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;readonly&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;FONT color=#000000&gt;LeftBracket&lt;/FONT&gt; = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt;(); &lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// "(" &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;readonly&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;FONT color=#000000&gt;RightBracket&lt;/FONT&gt; = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt;(); &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#008000 size=2&gt;// ")" &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#008000&gt;// Switch statment for character&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000&gt;// ....&lt;/FONT&gt;&lt;BR&gt;else switch &lt;FONT color=#000000&gt;(ch)&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;{&amp;nbsp;&lt;FONT face=Verdana&gt; &lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;case&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;','&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;:&lt;/FONT&gt;&lt;FONT face=Verdana color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;input.Read();&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt;result.Add(&lt;/FONT&gt;&lt;FONT size=2&gt;Scanner&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;.Comma);&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;break&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;FONT face=Verdana&gt; &lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;case&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;'('&lt;/FONT&gt;&lt;FONT size=2&gt;:&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;input.Read();&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt;result.Add(&lt;/FONT&gt;&lt;FONT size=2&gt;Scanner&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;.LeftBracket);&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;break&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;case&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;')'&lt;/FONT&gt;&lt;FONT size=2&gt;:&lt;BR&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;input.Read();&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt;result.Add(&lt;/FONT&gt;&lt;FONT size=2&gt;Scanner&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;.RightBracket);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;break&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;BR&gt;&lt;/FONT&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#008000&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;&lt;STRONG&gt;Additons to Ast.cs:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face=Verdana color=#000000&gt;Then, I created a class to hold a function call. &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; FunctionCall : Stmt 
{ 
    &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; List&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; DotedScopes; 
    &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; FunctionName; 
    &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; List&amp;lt;Expr&amp;gt; Args; 

    &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; FunctionCall() 
    { 
        DotedScopes = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; List&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt;(); 
        Args = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; List&amp;lt;Expr&amp;gt;(); 
    } 
}&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;&lt;STRONG&gt;Additons to Parser.cs for class Paser:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;I need to make additions to the Parser so that it can parse the function call into the the class I created in Ast.cs.&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color=#000000 size=2&gt;    &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; FunctionCall ParseFunc() 
    { 
        &lt;SPAN style="COLOR: green"&gt;//Function calls&lt;/SPAN&gt; 
        FunctionCall func = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; FunctionCall(); 

        &lt;SPAN style="COLOR: green"&gt;// function scope&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: blue"&gt;while&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index + &lt;SPAN style="COLOR: maroon"&gt;1&lt;/SPAN&gt; &amp;lt; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens.Count 
            &amp;amp;&amp;amp; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index + &lt;SPAN style="COLOR: maroon"&gt;1&lt;/SPAN&gt;] == Scanner.Dot) 
        { 
            func.DotedScopes.Add((&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;)&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index++]); 
            &lt;SPAN style="COLOR: green"&gt;// Skips the dot&lt;/SPAN&gt; 
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index++; 
        } 
        &lt;SPAN style="COLOR: green"&gt;// Function Name&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index == &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens.Count || 
            !(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index] &lt;SPAN style="COLOR: blue"&gt;is&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;)) 
        { 
            &lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Exception(&lt;SPAN style="COLOR: maroon"&gt;"expected function name after scope"&lt;/SPAN&gt;); 
        } 
        func.FunctionName = (&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;)&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index++]; 

        &lt;SPAN style="COLOR: green"&gt;// Arguments&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index == &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens.Count || 
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index] != Scanner.LeftBracket) 
        { 
            &lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Exception(&lt;SPAN style="COLOR: maroon"&gt;"expect open bracket after function name"&lt;/SPAN&gt;); 
        } 
        &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index++;   &lt;SPAN style="COLOR: green"&gt;// Skip Left Bracket&lt;/SPAN&gt; 

        &lt;SPAN style="COLOR: blue"&gt;while&lt;/SPAN&gt; ((&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index] != Scanner.RightBracket) 
            &amp;amp;&amp;amp; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index &amp;lt; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens.Count)) 
        { 
            func.Args.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.ParseExpr()); 
            &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index] == Scanner.Comma) 
                &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index++; &lt;SPAN style="COLOR: green"&gt;// Skip comma&lt;/SPAN&gt; 
            &lt;SPAN style="COLOR: blue"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index] == Scanner.RightBracket) 
                &lt;SPAN style="COLOR: blue"&gt;break&lt;/SPAN&gt;; 
            &lt;SPAN style="COLOR: blue"&gt;else&lt;/SPAN&gt; 
                &lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Exception(&lt;SPAN style="COLOR: maroon"&gt;"unexpected character in arg list"&lt;/SPAN&gt;); 
        } 

        &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index == &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens.Count || 
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tokens[&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index] != Scanner.RightBracket) 
        { 
            &lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Exception(&lt;SPAN style="COLOR: maroon"&gt;"expect close bracket after open bracket/args"&lt;/SPAN&gt;); 
        } 
        &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.index++;   &lt;SPAN style="COLOR: green"&gt;// Skip RightBracket&lt;/SPAN&gt; 

        &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; func; 
    } 
} 
&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;Additons to CodeGen.cs for class CodeGen&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Now, the best part of writing a compiler... the actual code generation.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; CallFunction(FunctionCall func, &lt;SPAN style="COLOR: blue"&gt;out&lt;/SPAN&gt; System.Type returnType) 
    { 
        System.Type[] typeArray = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Type[func.Args.Count]; 
        &lt;SPAN style="COLOR: blue"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; i = &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt;; i &amp;lt; func.Args.Count; i++) 
        { 
            typeArray[i] = &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.TypeOfExpr(func.Args[i]); 
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.GenExpr(func.Args[i], &lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;)); 
        } 
        Reflect.MethodInfo mi = &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;; 
        &lt;SPAN style="COLOR: green"&gt;// BCL calls&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (func.DotedScopes.Count &amp;gt; &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt;) 
        { 
            Text.StringBuilder scope = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; Text.StringBuilder(); 
            &lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; str &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; func.DotedScopes) 
            { 
                scope.Append(str + &lt;SPAN style="COLOR: maroon"&gt;"."&lt;/SPAN&gt;); 
            } 
            &lt;SPAN style="COLOR: green"&gt;// Remove the last dot&lt;/SPAN&gt; 
            scope.Remove(scope.Length - &lt;SPAN style="COLOR: maroon"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="COLOR: maroon"&gt;1&lt;/SPAN&gt;); 
            System.Type type = System.Type.GetType(scope.ToString()); 
            mi = type.GetMethod(func.FunctionName, typeArray); 
        } 
        &lt;SPAN style="COLOR: blue"&gt;else&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: green"&gt;// Local Function calls&lt;/SPAN&gt; 
        { 
            &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (!&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.symbolTable.FunctionTable.ContainsKey(func.FunctionName)) 
            { 
                &lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Exception(&lt;SPAN style="COLOR: maroon"&gt;"function \""&lt;/SPAN&gt; + func.FunctionName + &lt;SPAN style="COLOR: maroon"&gt;"\" not declared"&lt;/SPAN&gt;);     
            } 
            mi = &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.symbolTable.FunctionTable[func.FunctionName]; 
        } 
        returnType = mi.ReturnType; 
        &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.il.Emit(Emit.OpCodes.Call, mi); 
    } 
&lt;/PRE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=482091" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kathykam/archive/tags/Code+samples/default.aspx">Code samples</category></item><item><title>Hello World - Reflection Style</title><link>http://blogs.msdn.com/kathykam/archive/2005/09/21/472566.aspx</link><pubDate>Thu, 22 Sep 2005 00:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472566</guid><dc:creator>KathyKam</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/kathykam/comments/472566.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kathykam/commentrss.aspx?PostID=472566</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kathykam/rsscomments.aspx?PostID=472566</wfw:comment><description>&lt;P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;My name is Kathy Kam and&amp;nbsp;I am&amp;nbsp;the newest&amp;nbsp;addition to the Common Language Runtime (CLR) Program Management (PM) team. Like another PM on my team, &lt;A href="/joelpob/"&gt;JoelPob&lt;/A&gt;, I also grew up in the "Land Down Under". I left Sydney&amp;nbsp;to pursue a degree in Computer Engineering and Mathematics at the &lt;A href="http://www.umich.edu/"&gt;University of Michigan - Ann Arbor&lt;/A&gt;. Upon graduation, I joined Microsoft as a developer for &lt;A href="http://office.microsoft.com/"&gt;Microsoft Office Outlook&lt;/A&gt;. Four years later, after shipping Microsoft Office System 2003, a handful of&amp;nbsp;Service Packs and working on Office 12 for two years, I decided to become a PM on the CLR team and here I am, writing my first post! &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;This blog will be a record of my insights to the .NET world.&amp;nbsp;In the computing community, t&lt;/FONT&gt;&lt;FONT face=Tahoma size=2&gt;he first thing&amp;nbsp;any developer writes is a "Hello World" program. Since this is a blog for all the computer geeks in us. H&lt;/FONT&gt;&lt;FONT face=Tahoma size=2&gt;ere&amp;nbsp;it is, "Hello World"&amp;nbsp;Reflection style:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;using System;&lt;BR&gt;using System.Reflection;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;namespace HelloWorld&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class Program&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void Main(string[] args)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (FieldInfo fi in typeof(HelloObj).GetFields())&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Write(fi.Name + " ");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class HelloObj&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // My output&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Hello;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int World;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public bool from;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int[] Kathy;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public float Kam;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The output will be:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #000000" face=Tahoma color=#ffff00 size=2&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" color=#006400&gt;&amp;gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #000000" face=Tahoma color=#ffff00 size=2&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" color=#006400&gt;Hello World from Kathy Kam&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=472566" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kathykam/archive/tags/Code+samples/default.aspx">Code samples</category></item></channel></rss>