<?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>The Visual Basic Team : Orcas</title><link>http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx</link><description>Tags: Orcas</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>LINQ Cookbook, Recipe 3: Find all the prime numbers in a given range</title><link>http://blogs.msdn.com/vbteam/archive/2007/06/28/linq-cookbook-recipe-3-find-all-the-prime-numbers-in-a-given-range.aspx</link><pubDate>Thu, 28 Jun 2007 20:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3590361</guid><dc:creator>VBTeam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/3590361.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=3590361</wfw:commentRss><description>&lt;H1 class=entryviewheading&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Ingredients:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Visual Studio 2008 (Beta2 or Higher)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Categories: LINQ-To-Objects&lt;/FONT&gt;&lt;/FONT&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Instructions:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Open Visual Studio 2008, and Click ‘File/New Project’. &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Find and double-click the ‘Console Application’ Icon&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Add the following code:&lt;/FONT&gt;&lt;/FONT&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Module&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; Module1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Main()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; primes = GetPrimesInRange(1, 1000)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&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;Each&lt;/SPAN&gt; n &lt;SPAN style="COLOR: blue"&gt;In&lt;/SPAN&gt; primes&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;Next&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.ReadLine()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; GetPrimesInRange(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; low, &lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; high) &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; IEnumerable(&lt;SPAN style="COLOR: blue"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; range = Enumerable.Range(low, high)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;From&lt;/SPAN&gt; num &lt;SPAN style="COLOR: blue"&gt;In&lt;/SPAN&gt; range _&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;SPAN style="COLOR: blue"&gt;From&lt;/SPAN&gt; num2 &lt;SPAN style="COLOR: blue"&gt;In&lt;/SPAN&gt; range _&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;SPAN style="COLOR: blue"&gt;Where&lt;/SPAN&gt; num &lt;SPAN style="COLOR: blue"&gt;Mod&lt;/SPAN&gt; num2 = 0 _&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;SPAN style="COLOR: blue"&gt;Group&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;By&lt;/SPAN&gt; num &lt;SPAN style="COLOR: blue"&gt;Into&lt;/SPAN&gt; Count() _&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;SPAN style="COLOR: blue"&gt;Where&lt;/SPAN&gt; Count = 2 _&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;SPAN style="COLOR: blue"&gt;Select&lt;/SPAN&gt; num&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;End&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: blue"&gt;Module&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The grouping is used to select only those numbers that have exactly two factors (i.e. they're prime)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3590361" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Jonathan+Aneja/default.aspx">Jonathan Aneja</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ+Cookbook/default.aspx">LINQ Cookbook</category></item><item><title>Closures in VB Part 4: Variable Lifetime</title><link>http://blogs.msdn.com/vbteam/archive/2007/06/15/closures-in-vb-part-4-variable-lifetime.aspx</link><pubDate>Fri, 15 Jun 2007 21:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3320082</guid><dc:creator>VBTeam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/3320082.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=3320082</wfw:commentRss><description>&lt;P&gt;For previous articles in this series please see 
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx"&gt;Part 1: Introduction&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/03/closures-in-vb-part-2-method-calls.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/03/closures-in-vb-part-2-method-calls.aspx"&gt;Part 2: Method Calls&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/25/closures-in-vb-part-3-scope.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/25/closures-in-vb-part-3-scope.aspx"&gt;Part 3: Scope&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Sorry for the long delay between posts here.&amp;nbsp; We're getting Orcas out the door and getting this series completed takes a back seat to shipping.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Originally I wanted to talk about looping structures next.&amp;nbsp; However when I started writing that post I realized that I had to talk about lifetime before the looping structures would make sense.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Prior to Orcas the lifetime of a variable in VB was the entire function.&amp;nbsp; This presented several problems from a closures perspective.&amp;nbsp; Imagine you had a looping structure and the value was used in a lambda expression.&amp;nbsp; &lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; LifetimeExample()
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; list &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt; List(Of Func(Of &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;))
        &lt;SPAN style="COLOR: blue"&gt;For&lt;/SPAN&gt; i = &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;To&lt;/SPAN&gt; &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;

            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; x = i * &lt;SPAN style="COLOR: maroon"&gt;2&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; &lt;SPAN style="COLOR: maroon"&gt;True&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Then&lt;/SPAN&gt;
                list.Add(&lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;() x)
            &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Next&lt;/SPAN&gt;

        &lt;SPAN style="COLOR: blue"&gt;For&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Each&lt;/SPAN&gt; f &lt;SPAN style="COLOR: blue"&gt;In&lt;/SPAN&gt; list
            Console.Write(f() &amp;amp; " ")
        &lt;SPAN style="COLOR: blue"&gt;Next&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;In this example if we left the lifetime rules unchanged, there would be a single variable "x" for the entire function.&amp;nbsp; That means that we would end up printing out &lt;/P&gt;
&lt;P&gt;10 10 10 10 10&lt;/P&gt;
&lt;P&gt;This is somewhat unexpected and essentially means that VB could not support complex Lambda scenarios.&amp;nbsp; To fix this we altered the lifetime of variables to be tied to the scope they were contained in.&amp;nbsp; The end effect is that each iteration of the loop has a separate "x" since each iteration enters and leaves the scope of the "if" statement.&amp;nbsp; As a result it will print out &lt;/P&gt;
&lt;P&gt;0 2 4 6 8 10&lt;/P&gt;
&lt;P&gt;We did make one backcompat adjustment for this change.&amp;nbsp; The lifetime of variables in VB was visible if you tried to use an uninitialized variable in a loop/goto.&amp;nbsp; For instance the following code will also print out 0 2 4 6 8 10 because it takes advantage of the fact that the variable "x" has a lifetime longer than the loop.&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; VisibleLifetime()
        &lt;SPAN style="COLOR: blue"&gt;For&lt;/SPAN&gt; i = &lt;SPAN style="COLOR: maroon"&gt;0&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;To&lt;/SPAN&gt; &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; x &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
            Console.WriteLine(x)
            x += &lt;SPAN style="COLOR: maroon"&gt;2&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Next&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;To make sure that we didn't break any existing code we had one little errata for the change.&amp;nbsp; When a variable's scope is re-entered, and hence recreated, and it is not initialized to a value it will get the last value of the variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jared Parsons (&lt;A href="http://blogs.msdn.com/jaredpar" mce_href="http://blogs.msdn.com/jaredpar"&gt;http://blogs.msdn.com/jaredpar&lt;/A&gt;&amp;nbsp;)&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3320082" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Jared+Parsons/default.aspx">Jared Parsons</category></item><item><title>What is the difference between VB 9, VBx and Silverlight? (Scott Wisniewski)</title><link>http://blogs.msdn.com/vbteam/archive/2007/06/07/what-is-the-difference-between-vb-9-vbx-and-silverlight.aspx</link><pubDate>Fri, 08 Jun 2007 01:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3152912</guid><dc:creator>VBTeam</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/3152912.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=3152912</wfw:commentRss><description>&lt;P&gt;I recently received an email from a customer asking for clarification as to what the difference was between &lt;A href="http://msdn2.microsoft.com/en-us/library/ms364068(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms364068(VS.80).aspx"&gt;VB 9&lt;/A&gt;, &lt;A href="http://www.panopticoncentral.net/archive/2007/05/01/20383.aspx" mce_href="http://www.panopticoncentral.net/archive/2007/05/01/20383.aspx"&gt;VBx&lt;/A&gt; and &lt;A href="http://silverlight.net/" mce_href="http://silverlight.net/"&gt;Sliverlight&lt;/A&gt;. In particular, it seems as if we have been releasing so much information about cool new stuff that at least a few people have become confused, making them a bit nervous about the future of VB. &lt;/P&gt;
&lt;P&gt;The customer had also expressed some concerns about upgrading from VS 2005 to Orcas (VS 2008), particularly because he was considering making an upgrade from VB 6 to VS 2005 and wanted to make sure he would be able to take advantage of &lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa700830.aspx" mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa700830.aspx"&gt;Orcas&lt;/A&gt; when it was released. &lt;/P&gt;
&lt;P&gt;I figured there may be other customers that have similar concerns, and so thought this would make a good blog post, particularly because it's been a while since I've posted anything (&lt;SPAN style="FONT-FAMILY: Wingdings"&gt;J&lt;/SPAN&gt;). &lt;/P&gt;
&lt;P&gt;As a result I've included a few of the questions he asked (paraphrased) below, along with my answers. &lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What is the difference between VB 9 and VBx? Which one is the next version of Visual Studio?&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;Visual Basic 9 is the next version of Visual Basic. Visual Basic 10, or VBx as it's sometimes called, is the version of Visual Basic that will follow VB 9. Currently VBx is in very early stages, and is a long way off from production. In fact, most of our development team is actively working on VB 9. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Why on earth would you start talking about VB 10 before you've even released VB 9? This is confusing. &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The product cycle for VB 9 is starting to wind down. We recently released Beta 1 of Visual Studio Code Name "Orcas", and are currently working on releasing Beta 2. As the product cycle starts to wind down, our language design team is starting to think about what the "next next" version of the product will look like. They do this mainly as a way to "keep the pipeline moving". If they had to wait until VB 9 was 100% complete before they started thinking about VB 10, then there would end up being a significant delay from when we finished VB 9 until we could start working on VB 10. This is because designing a product, and coming up with a plan to develop it can be extremely time consuming. It requires us to come up with a design, create a schedule, make any necessary organizational changes, and ensure we have the right staffing levels, all before we start coding. By "overlapping" the early design work for VB 10 with the "end game" work for VB 9 we are able to better "bootstrap" the whole process, thus making the transition from one project to the next as smooth as possible. &lt;/P&gt;
&lt;P&gt;As our design team comes up with designs they like to release information about them as early as possible. The earlier we can get information out to our customers, the earlier we can get feedback about the things we are doing. This helps us to build the products that actually meet our customers' needs. One thing we've managed to learn over the years is that the best possible way we can learn what it is that our customers want is to engage with them early and often. &lt;/P&gt;
&lt;P&gt;As a result, near the end of a product cycle we will release information about our plans for the version of the product to follow the one we are currently working on. This gives our customers the chance to comment on it and let us know what they think. We then take that feedback and use it to develop a more complete plan for what we want to do. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What is VB 10 going to be like? What is this Silverlight Thing I keep hearing about? Is Silverlight a replacement for Visual Studio? &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Our plans for VBx and Silverlight are still very rough and are nowhere near complete. As our customers start to use VB 9 and provide us with feedback that data will drive exactly what we end up doing in VB 10. That being said, however, we do have some rough ideas of the things we would like to do. &lt;/P&gt;
&lt;P&gt;Silverlight 1.1 is a new light weight version of the .NET Framework that will allow you to develop rich applications that run in a web browser using .NET languages. The basic idea is to allow you to replace client side java script with .NET enabled languages, allowing you to write both the client side and sever side portions of your web applications in the same language. It also allows you to use WPF (windows presentation foundation) and WCF (windows communication foundation) to create extremely rich and interactive web applications in a way that is much easier than what is possible using HTML, Ajax, Java Script, or Flash. &lt;/P&gt;
&lt;P&gt;VB 10 is going to be the version of Visual Basic that will follow VB 9 (the "next next version"). It will include new features designed to make VB a really great language for developing SilverLight apps, as well as enhancements to many of the new feature we are delivering in VB 9, such as Linq. You should still be able to do all the things with VB 10 that you could do with both VB 9 and VB 8. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The migration from VB 6 to VS 2005 is non-trivial. If I upgrade to VS 2005 will I able to use VB 9 when it comes out, or will I have to scrap all my work? What about VB 10? Should I be worried about the future of VB?&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;The transition from VB 8.0 to VB 9.0 should be smooth and relatively painless. We have gone to great lengths to ensure this. &lt;/P&gt;
&lt;P&gt;Our plan is to also make the migration from VB 9 to VB 10 equally painless. &lt;/P&gt;
&lt;P&gt;Although the migration from VB 6 to VB.NET is a bit tough, we are actively working on making that easier as well. We have been releasing a "VB Interoperability Toolkit" that allows an application to be gradually migrated from VB 6 to VS 2005, rather than requiring the whole thing to be migrated at once. &lt;/P&gt;
&lt;P&gt;You can get more information about it here: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/en-us/vbasic/aa701257.aspx" mce_href="http://msdn2.microsoft.com/en-us/vbasic/aa701257.aspx"&gt;http://msdn2.microsoft.com/en-us/vbasic/aa701257.aspx&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;As far as the future of VB, you should definitely not be worried. &lt;/P&gt;
&lt;P&gt;Microsoft is committed to VB, and making it a great language for developing applications for our various platforms. The future of VB should be a bright one!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3152912" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Scott+Wisniewski/default.aspx">Scott Wisniewski</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/VB2005/default.aspx">VB2005</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/DLR/default.aspx">DLR</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Visual Basic LINQ Hands On Labs for Orcas Beta 1 (Beth Massi)</title><link>http://blogs.msdn.com/vbteam/archive/2007/06/04/visual-basic-linq-hands-on-labs-for-orcas-beta-1-beth-massi.aspx</link><pubDate>Mon, 04 Jun 2007 18:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3084539</guid><dc:creator>VBTeam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/3084539.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=3084539</wfw:commentRss><description>&lt;P&gt;The VB team just posted some &lt;A class="" href="http://download.microsoft.com/download/7/2/3/723ae16d-8129-44f1-b0d0-1a20e0a4c24b/LINQ_Hands_on_Lab%20VB.doc" mce_href="http://download.microsoft.com/download/7/2/3/723ae16d-8129-44f1-b0d0-1a20e0a4c24b/LINQ_Hands_on_Lab VB.doc"&gt;Hands On Labs on LINQ&lt;/A&gt; and &lt;A class="" href="http://download.microsoft.com/download/7/2/3/723ae16d-8129-44f1-b0d0-1a20e0a4c24b/LINQ_To_SQL_Hands_on_Lab%20VB.doc" mce_href="http://download.microsoft.com/download/7/2/3/723ae16d-8129-44f1-b0d0-1a20e0a4c24b/LINQ_To_SQL_Hands_on_Lab VB.doc"&gt;LINQ to SQL&lt;/A&gt; for Orcas Beta 1. &lt;A class="" href="http://download.microsoft.com/download/7/2/3/723ae16d-8129-44f1-b0d0-1a20e0a4c24b/LINQ_Hands_on_Lab%20VB.doc" mce_href="http://download.microsoft.com/download/7/2/3/723ae16d-8129-44f1-b0d0-1a20e0a4c24b/LINQ_Hands_on_Lab VB.doc"&gt;The first lab&lt;/A&gt; provides an introduction to &lt;A class="" href="http://msdn2.microsoft.com/en-us/vbasic/aa904594.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/vbasic/aa904594.aspx"&gt;The LINQ Project&lt;/A&gt;. You'll look at basic LINQ features including the Standard Query Operators, and you'll see how these features can be used against in-memory collections, connected databases, and XML documents. &lt;A class="" href="http://download.microsoft.com/download/7/2/3/723ae16d-8129-44f1-b0d0-1a20e0a4c24b/LINQ_To_SQL_Hands_on_Lab%20VB.doc" mce_href="http://download.microsoft.com/download/7/2/3/723ae16d-8129-44f1-b0d0-1a20e0a4c24b/LINQ_To_SQL_Hands_on_Lab VB.doc"&gt;The second lab&lt;/A&gt;&amp;nbsp;aims to&amp;nbsp;provide a clear picture of the relational data access support provided by the LINQ Project, referred to as LINQ to SQL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P&gt;- &lt;A class="" href="http://blogs.msdn.com/bethmassi/" target=_blank mce_href="http://blogs.msdn.com/bethmassi/"&gt;Beth Massi&lt;/A&gt;, VS Community&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3084539" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Beth+Massi/default.aspx">Beth Massi</category></item><item><title>Closures in VB Part 3: Scope</title><link>http://blogs.msdn.com/vbteam/archive/2007/05/25/closures-in-vb-part-3-scope.aspx</link><pubDate>Fri, 25 May 2007 21:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2880645</guid><dc:creator>VBTeam</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2880645.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2880645</wfw:commentRss><description>&lt;P&gt;Jared here again.&amp;nbsp; For previous articles in this series please see&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx"&gt;Part 1: Introduction&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/03/closures-in-vb-part-2-method-calls.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/03/closures-in-vb-part-2-method-calls.aspx"&gt;Part 2: Method Calls&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Thus far in the series we've only lifted variables that are declared in the same block/scope.&amp;nbsp;What happens if we lift variables in different scope?&amp;nbsp; The answer is that one closure class will be created for every unique scope where a lifted variable is declared and all of the variables in that scope that are lifted will be placed in that closure.&amp;nbsp; Once again, examples speak best&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Scope1()
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; x = &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; f1 = &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; z &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;) x + z
        Console.WriteLine(f1(&lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;))
        &lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; x &amp;gt; &lt;SPAN style="COLOR: maroon"&gt;2&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; y = &lt;SPAN style="COLOR: maroon"&gt;6&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; g = &lt;SPAN style="COLOR: maroon"&gt;7&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; f2 = &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; z &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;) z + y + g
            Console.WriteLine(f2(&lt;SPAN style="COLOR: maroon"&gt;4&lt;/SPAN&gt;))
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;The code will end up looking like so ...&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; Closure1
        &lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; x &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;

        &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; Lambda_f1(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; z &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;)
            &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; x + z
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; Closure2
        &lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; y &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; g &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;

        &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; Lambda_f2(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; z &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;)
            &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; y + z + g
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Scope1()
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; c1 &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt; Closure1()
        c1.x = &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;
        Console.WriteLine(c1.Lambda_f1(&lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;))
        &lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; c1.x &amp;gt; &lt;SPAN style="COLOR: maroon"&gt;2&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; c2 &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt; Closure2()
            c2.y = &lt;SPAN style="COLOR: maroon"&gt;6&lt;/SPAN&gt;
            c2.g = &lt;SPAN style="COLOR: maroon"&gt;7&lt;/SPAN&gt;
            Console.WriteLine(c2.Lambda_f2(&lt;SPAN style="COLOR: maroon"&gt;4&lt;/SPAN&gt;))
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;There are a couple of items to take away from this example.&amp;nbsp; &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Only two closure classes were created even though three variables were lifted.&amp;nbsp; The number of closures only depends on the number of scopes of all of the lifted declared variables. 
&lt;LI&gt;The closures are created at the begining of the scope they are associated and not at the begining of the method.&amp;nbsp; This will be more important in the next part of the series. 
&lt;LI&gt;Each lambda instance is attached to the closure associated with the scope the lambda is declared in.&amp;nbsp; &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;The next&amp;nbsp;twist is what were to happen if&amp;nbsp;the lambda "f2" were to also use the variable "x".&amp;nbsp; As it's currently written there is no association between Closure1 and Closure2 therefore&amp;nbsp;there is no way for it to access the lifted variable.&amp;nbsp; The answer is two fold.&amp;nbsp;&amp;nbsp;Firstly to&amp;nbsp;reduce clutter I pasted the closure classes as if they were separate entries.&amp;nbsp; In fact Closure2 would appear as a nested class of Closure1 in the real generated code.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Secondly if x were used inside of "f2", the real use would be "c1.x".&amp;nbsp; That's (almost) no different than "someOtherVar.x".&amp;nbsp; Therefore the instance of c1 will be lifted into Closure2.&amp;nbsp; &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; f2 = &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; z &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;) z + y + g + x&lt;/PRE&gt;
&lt;P&gt;Woud result in the following definition of Closure2 ...&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; Closure2
        &lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; y &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; g &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; c1 &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; Closure1

        &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; Lambda_f2(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; z &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;)
            &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; y + z + g + c1.x
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;In deeply nested lambdas and scopes this type of lifting will continue recursively.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;That's it for this entry, the next article will talk about looping structures and possibly variable lifetime.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2880645" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Jared+Parsons/default.aspx">Jared Parsons</category></item><item><title>Closures in VB Part 2: Method Calls</title><link>http://blogs.msdn.com/vbteam/archive/2007/05/03/closures-in-vb-part-2-method-calls.aspx</link><pubDate>Thu, 03 May 2007 23:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2401443</guid><dc:creator>VBTeam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2401443.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2401443</wfw:commentRss><description>&lt;P&gt;For previous articles in this series, please see&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx"&gt;Part 1 - The basics&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Jared here again.&amp;nbsp; This part of the series will focus on how method calls are handled in closures.&amp;nbsp;&amp;nbsp;As stated in the previous article, the purpose of closures is to allow all operations inside a lambda or query expression that would normally be available inside the function or sub.&amp;nbsp; To do this closures often need to capture (or lift) relevant variables from the function into the generated class.&lt;/P&gt;
&lt;P&gt;There are&amp;nbsp;2 types of methods and method calls that closures have to handle.&amp;nbsp; &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Method calls to a shared method or methods on modules. 
&lt;LI&gt;Method calls to instance members of a class &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Scenario #1 &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Below is an example of a method call inside a lambda expression for scenario #1.&amp;nbsp; &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;Module&lt;/SPAN&gt; M1

    &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; MyValue() &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="COLOR: maroon"&gt;42&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Example1()
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; x = &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; f = &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;() x + MyValue()
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;

&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Module&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Here we are calling a&amp;nbsp;module method inside a lambda.&amp;nbsp; Module Methods or Shared methods can be called from anywhere because they require no specific variable for the call.&amp;nbsp; This requires no special work from closures as the call can just be made naturally.&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; Closure
        &lt;SPAN style="COLOR: blue"&gt;Private&lt;/SPAN&gt; x &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;

        &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; Lambda_f() &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; x + M1.MyValue
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Scenario #2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Calling an instance method is more difficult than a shared method because it requires the referenc "Me".&amp;nbsp; If you don't type this specifically in code the VB Compiler will add it for you under the hood.&amp;nbsp; To make this work the closures code will also "lift" the variable "Me" in the same way that it lifts normal variables in a function.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Calling a instance method inside a lambda expression is little difference than calling a member method on a variable used in a lambda.&amp;nbsp; The only difference is the variable is "Me".&amp;nbsp; For example&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; C1
    &lt;SPAN style="COLOR: blue"&gt;Private&lt;/SPAN&gt; m_myValue &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; MyValue() &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; m_myValue
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Example2()
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; x = &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; f = &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;() x + MyValue()
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;
&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;In this case we need to access both "x" and "Me.MyValue()" from the closure.&amp;nbsp; The generated code will create space for both of these variables and the transformed code in Example2 will store both of the values.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; Closure
    &lt;SPAN style="COLOR: blue"&gt;Private&lt;/SPAN&gt; x &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;Private&lt;/SPAN&gt; OriginalMe &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; C1

    &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; Lambda_f()
        &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; x + OriginalMe.MyValue()
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;
&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Example2()
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; c &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt; Closure
        c.x = &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;
        c.OriginalMe = &lt;SPAN style="COLOR: blue"&gt;Me&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; f = &lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt; Func(Of &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;)(&lt;SPAN style="COLOR: blue"&gt;AddressOf&lt;/SPAN&gt; c.Lambda_f)
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;As usual, the generated code is much uglier but this essentially what will be generated.&amp;nbsp; That wraps it up for method calls.&amp;nbsp; In the next part, I will discuss the variable liftetime and scoping issues that come into play with closures.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Jared Parsons&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/jaredpar" mce_href="http://blogs.msdn.com/jaredpar"&gt;http://blogs.msdn.com/jaredpar&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2401443" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Jared+Parsons/default.aspx">Jared Parsons</category></item><item><title>Closures in VB: Part 1</title><link>http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx</link><pubDate>Thu, 03 May 2007 03:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2386096</guid><dc:creator>VBTeam</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2386096.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2386096</wfw:commentRss><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My name is Jared Parsons and I am a developer on the VB Compiler and Debugger.&amp;nbsp; One of the features I implemented for VB 9.0 is lexical closure support.&amp;nbsp; This a great addition to the VB language and I wanted to do a series of blog posts to describe this feature and how it will impact your code.&lt;/P&gt;
&lt;P&gt;Lexical Closures (more often referred to as simply Closures) are the underpinnings for several new features in Visual Basic 9.0.&amp;nbsp; The are part of the guts of Lambda and Query expressions.&amp;nbsp; This will be a several part series on Closures in VB 9.0; how they work, their limitations, pitfalls surrounding their use.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;To start off, let's get a basic summary of what a Closure is.&amp;nbsp; &lt;A href="http://en.wikipedia.org/wiki/Closure_%28computer_science%29" target=_blank mce_href="http://en.wikipedia.org/wiki/Closure_%28computer_science%29"&gt;Wikipedia&lt;/A&gt; defines it as "... a&amp;nbsp; is a semantic concept referring to a function paired with an environment ...".&amp;nbsp; I prefer to describe it as follows.&amp;nbsp; A closure is a feature which allows users to seemlessly access an environment (locals, parameters&amp;nbsp;and methods) from more than one function.&amp;nbsp; Even better are samples :) &lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; C1
        &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Test()
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; x = &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; f = &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; y &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;) x + y
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; result = f(&lt;SPAN style="COLOR: maroon"&gt;42&lt;/SPAN&gt;)
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;In this code we have a lambda expression which takes in a single parameter and adds it with a local variable.&amp;nbsp; Lambda expressions are implemented as functions in VB (and C#).&amp;nbsp; So now we have two functions, "Test" and "f", which are accessing a single local variable.&amp;nbsp; This is where closures come into play.&amp;nbsp; Closures are responsible for making the single variable "x" available to both functions in a process that is referred to as "lifting the variable".&lt;/P&gt;
&lt;P&gt;To do this the compiler will take essentially&amp;nbsp;4 actions.&amp;nbsp; &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a class which will contain "x" in order to share it among both functions.&amp;nbsp; Call it "Closure" for now 
&lt;LI&gt;It will create a new function for the lambda expression in the class "Closure".&amp;nbsp; Call it "f" for now 
&lt;LI&gt;Create a new instance of the class "Closure" inside the sub "Test" 
&lt;LI&gt;Rewrite all access of "x" into the member "x" of "Closure".&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; Closure
        &lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; x &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;

        &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; f(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; y &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;) &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; x + y
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; C1
        &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Test()
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; c &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt; Closure()
            c.x = &lt;SPAN style="COLOR: maroon"&gt;5&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; f &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; Func(Of &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;) = &lt;SPAN style="COLOR: blue"&gt;AddressOf&lt;/SPAN&gt; c.f
            &lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; result = f(&lt;SPAN style="COLOR: maroon"&gt;42&lt;/SPAN&gt;)
        &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Now "x" is shared amongst both functions and the user didn't have to know anything about the code we generated.&amp;nbsp; You can see from this simplified example just how much code Closures and all of the other new VB 9.0 features are saving you here (Type Inference, Lambda Expressions).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Note this is only a simulation of what is generated when you use a closure, the actual generated code is much uglier and involves lots of unbindable names "$Lambda_1", etc ... &lt;/P&gt;
&lt;P&gt;In the next part of this article I'll dive into some more uses of closures (multiple variables, method access, &amp;nbsp;terminology, etc...).&lt;/P&gt;
&lt;P&gt;Jared Parsons&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.msdn.com/jaredpar" mce_href="https://blogs.msdn.com/jaredpar"&gt;https://blogs.msdn.com/jaredpar&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2386096" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Jared+Parsons/default.aspx">Jared Parsons</category></item><item><title>VB On Silverlight</title><link>http://blogs.msdn.com/vbteam/archive/2007/05/01/vb-on-silverlight.aspx</link><pubDate>Tue, 01 May 2007 20:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2362539</guid><dc:creator>VBTeam</dc:creator><slash:comments>29</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2362539.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2362539</wfw:commentRss><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the great things about being on the VB team is that we’re generally in the loop early and often with teams developing new technologies and products. It’s always exciting to see ideas take shape, evolve into a product, and eventually hit the market—often after four or five code names, a couple of tech previews, and a few release date/year extensions. Despite my best efforts, the sheer volume of new stuff coming out is a bit overwhelming; and maintaining more than a cursory understanding of the products that are incubating at Microsoft is pretty challenging. But when some partner teams started asking what it would take to write VB.NET code-behind for a browser plug-in that could run cross-browse &lt;B&gt;&lt;I&gt;and&lt;/I&gt; &lt;/B&gt;cross-platform, my interest was definitely peaked. “Let me get this straight… You want to write a web plug-in VB.NET… that doesn’t require the full .NET framework to be installed… and runs on the Mac… and Firefox … but supports the full VB.NET language? Uh… Okay, let’s chat.” 
&lt;P&gt;It has only been a few months and a handful codename changes since we had that discussion (For a humorous history of Silverlight’s codenames, check out &lt;A href="http://blogs.msdn.com/tims/archive/2007/04/18/how-did-we-come-up-with-silverlight.aspx" mce_href="http://blogs.msdn.com/tims/archive/2007/04/18/how-did-we-come-up-with-silverlight.aspx"&gt;Tim Sneath’s blog&lt;/A&gt;.) , and despite a number of obstacles, we’re getting there with the Alpha release of Silverlight v 1.1. And while I’m by no means a Silverlight guru, I have been using it for a little while now and I thought I’d shed some light on what’s out there for VB developers who are interested in trying out Silverlight v1.1. 
&lt;H2&gt;
&lt;H1 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Calibri color=#17365d size=5&gt;The Visual Basic Language on Silverlight&lt;/FONT&gt;&lt;/H1&gt;&lt;/H2&gt;
&lt;P&gt;Prior to the &lt;A href="http://metahost.origindigital.com/microsoft/20070430/mix07_20070430_500.asx" mce_href="http://metahost.origindigital.com/microsoft/20070430/mix07_20070430_500.asx"&gt;announcement of Silverlight 1.1&lt;/A&gt;, Silverlight plug-ins were written in XAML and Javascript. While the Javascript model is certainly powerful, using VB is always my preference—it’s a language I know well, and its flexibility suits my programming style. Not to mention that the introduction of VB.NET into the Silverlight world brings with it many of the .NET Framework’s types and APIs I’ve come to rely on. 
&lt;P&gt;If you’ve had a chance to &lt;A href="http://go.microsoft.com/fwlink/?LinkID=88986&amp;amp;clcid=0x409" mce_href="http://go.microsoft.com/fwlink/?LinkID=88986&amp;amp;clcid=0x409"&gt;download the Silverlight 1.1 runtime&lt;/A&gt;, you may have noticed that it’s MUCH smaller than the full .NET Framework at 4.2 MB (and hopefully shrinking!). Clearly, some things have been factored out of the .NET Framework to keep the download size down and installation time short. And although a lot has been removed, the core set of types is included along with some APIs that are particularly useful for writing plug-ins—things like a “lite” version of System.Xml.dll, support for making web service calls, and so on. When deciding what aspects of the Visual Basic language and runtime should be included with Silverlight v1.1, we tried to follow a similar pattern: we wanted to preserve the core VB programming experience—late binding, conversions, Linq, and so on; and we didn’t want to bloat the download size with anything that wasn’t absolutely necessary or didn’t make sense in Silverlight—things like some of the COM helpers (COM is not supported in Silverlight), financial functions, etc. It was a delicate balance to strike between functionality and overall size. The Silverlight 1.1 Alpha is our first crack at it… and it may be refined over the coming months with feedback. Here’s a laundry list of what’s supported/not supported currently. (If you’re interested in digging into the details, you can also view the types in the Object Browser using the tools described below.) 
&lt;H4&gt;&lt;B&gt;&lt;I&gt;Supported…&lt;/I&gt;&lt;/B&gt; &lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Late Binding&lt;/B&gt;: One of the most definitive features of the VB language, I find late binding to be especially useful in writing Silverlight code-behind. 
&lt;LI&gt;&lt;B&gt;Conversions&lt;/B&gt;: Implicit and explicit conversion operators are available—Ctype, CStr, etc. 
&lt;LI&gt;&lt;B&gt;Linq&lt;/B&gt;: Currently, Linq over objects is supported 
&lt;LI&gt;&lt;B&gt;String utilities&lt;/B&gt;: Len(), InStr(), Mid(), UCase(), etc 
&lt;LI&gt;&lt;B&gt;VB Collection&lt;/B&gt;: Most folks either love it or hate it. A subset of generic collections is also supported.&amp;nbsp; (Non-generic collections are considered obsolete for Silverlight.) 
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Dictionary(Of Key, Value)&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;List(Of T)&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;ArrayList (Obsolete)&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;BitArray (Obsolete)&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;Hashtable (Obsolete)&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;Queue (Obsolete)&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;SortedList (Obsolete)&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;Stack (Obsolete)&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;B&gt;Math utilities&lt;/B&gt;: Rnd(), Random() 
&lt;LI&gt;&lt;B&gt;IIF()&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;Information utilities&lt;/B&gt;: Things like IsNumeric(), IsDate(), UBound(), LBound(), and so on 
&lt;LI&gt;&lt;B&gt;Date utilities: &lt;/B&gt;Now(), TimeOfDay(), Year(), etc 
&lt;LI&gt;&lt;B&gt;Constants:&lt;/B&gt; vbCrLf, vbTab, etc. Some of the more obscure constants have been removed, but the core set is included. 
&lt;LI&gt;&lt;B&gt;All core VB&amp;nbsp;Language Constructs: &lt;/B&gt;Type Inference, anonymous delegates, Handles, etc&lt;B&gt;&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;H4&gt;&lt;B&gt;&lt;I&gt;Not Currently Supported…&lt;/I&gt;&lt;/B&gt; &lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;The My Namespace:&lt;/B&gt; We removed this for Alpha release because much of the existing My Namespace doesn’t make a ton of sense in Silverlight. &lt;B&gt;&lt;/B&gt;
&lt;LI&gt;&lt;B&gt;XML Literals: &lt;/B&gt;The compiler support for XML literals is present, but System.Xml.Linq (which the feature depends on) is not available in Silverlight 1.1. &lt;B&gt;&lt;/B&gt;
&lt;LI&gt;&lt;B&gt;COM Support: &lt;/B&gt;Silverlight plug-ins are not allowed to call COM components, so we removed the VB utilities related to COM (e.g., the COM Class attribute)&lt;B&gt;&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;FileSystem Object (VB6 Compatibility): &lt;/B&gt;Direct access to the file system is not permitted, so these APIs were removed. Alternatively, you might check out System.IO.IsolatedStorage if you need to persist data locally&lt;B&gt;&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;As a sort of test piece, I recently took a look at the &lt;A href="http://silverlight.net/samples/1.1/clock-vb/run/default.html" mce_href="http://silverlight.net/samples/1.1/clock-vb/run/default.html"&gt;Clock Sample&lt;/A&gt; and wanted to see if the feature set we settled on enabled me to write VB code as I normally would for a Windows Forms or WPF application. The code basically just sets the minute, second, and hour hands on the clock to the current time (approximately). Here’s what it looks like… 
&lt;BLOCKQUOTE&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;' Anonymous delegates, Handles--isn't it pretty?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Canvas_Loaded() &lt;SPAN style="COLOR: blue"&gt;Handles&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Me&lt;/SPAN&gt;.Loaded&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;InitializeComponent()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;' Type inference; DateTime functions&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; currentTime = Now&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;' Conversions, type inference&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; hourAngle = ((currentTime.Hour / 12) * 360 + currentTime.Minute / 2) + 180&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; minAngle = ((currentTime.Minute / 60) * 360) + 180&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; secAngle = ((currentTime.Second / 60) * 360) + 180&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;' hourAnimation is a generated variable that makes use of WithEvents and Conversions&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;'&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Protected WithEvents hourAnimation As DoubleAnimation&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;'&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Me.hourAnimation = CType(Me.FindName("hourAnimation"),DoubleAnimation)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hourAnimation.From = hourAngle&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hourAnimation.To = hourAngle + 360&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;minuteAnimation.From = minAngle&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;minuteAnimation.To = minAngle + 360&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;secondAnimation.From = secAngle&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;secondAnimation.To = secAngle + 360&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;End&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;All in all, this particular example looks and feels pretty VB to me—which isn’t to say we’ve nailed it by any means… but the example does give some indication as to the type of VB experience we’re striving for with Silverlight. Let us know what you think. 
&lt;H2&gt;
&lt;H1 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Calibri color=#17365d size=5&gt;Tools for building Silverlight Plug-ins with VB&lt;/FONT&gt;&lt;/H1&gt;&lt;/H2&gt;
&lt;P&gt;Unless you’re really into notepad , download the tools for Silverlight. The VS project templates alone are worth the bandwidth required, as they’ll get you started in the right direction. In addition, many of the more interesting things you can do with Silverlight (e.g., animations, embedding videos, etc) are pretty tedious to wire-up by hand in XAML; using Expression Blend makes the process &lt;B&gt;&lt;I&gt;*much*&lt;/I&gt;&lt;/B&gt; easier. All of the components mentioned below are available at: &lt;A href="http://silverlight.net/GetStarted/" mce_href="http://silverlight.net/GetStarted/"&gt;http://silverlight.net/GetStarted/&lt;/A&gt;. I’ve just included them here for convenience. 
&lt;H3&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Calibri color=#17365d size=4&gt;What to download&lt;/FONT&gt;&lt;/H2&gt;&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=88986&amp;amp;clcid=0x409" mce_href="http://go.microsoft.com/fwlink/?LinkID=88986&amp;amp;clcid=0x409"&gt;&lt;B&gt;Silverlight 1.1 Runtime&lt;/B&gt;: &lt;/A&gt;This is the version of Silverlight that enables you to write VB code-behind. It includes a version of the factored .NET Framework, including the VB runtime (Microsoft.VisualBasic.dll). 
&lt;LI&gt;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=89147&amp;amp;clcid=0x409" mce_href="http://go.microsoft.com/fwlink/?LinkID=89147&amp;amp;clcid=0x409"&gt;&lt;B&gt;ASP.NET Futures Runtime&lt;/B&gt;: &lt;/A&gt;Among other features, the controls included in this download make it much easier to embed Silverlight controls and rich media in existing ASP.NET web applications 
&lt;LI&gt;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=89146&amp;amp;clcid=0x409." mce_href="http://go.microsoft.com/fwlink/?LinkID=89146&amp;amp;clcid=0x409."&gt;&lt;B&gt;VS Orcas Beta 1&lt;/B&gt;:&lt;/A&gt; &lt;B&gt;&lt;I&gt;Note: &lt;/I&gt;&lt;/B&gt;&lt;I&gt;&lt;U&gt;You need to have the official Orcas Beta 1!&lt;/U&gt;&lt;/I&gt; Earlier CTPs won’t cut it. Even if you choose not to use Visual Studio to do your development, you’ll need the Beta 1 VB 9.0 compiler, as it includes some changes required to target the slimmed-down .NET Framework. 
&lt;LI&gt;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=89149&amp;amp;clcid=0x409" mce_href="http://go.microsoft.com/fwlink/?LinkID=89149&amp;amp;clcid=0x409"&gt;&lt;B&gt;VS Add-On for Silverlight:&lt;/B&gt;&lt;/A&gt; This component provides some project templates and IDE changes for building Silverlight applications in VB (and C#). 
&lt;LI&gt;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=79076&amp;amp;clcid=0x409" mce_href="http://go.microsoft.com/fwlink/?LinkID=79076&amp;amp;clcid=0x409"&gt;&lt;B&gt;Expression Blend 1.1 CTP&lt;/B&gt;&lt;/A&gt;: The VS Add-On mentioned above does not include a designer for Silverlight; editing XAML is done in the XML editor. While the XML editor does support IntelliSense, I find it much easier to perform the visual and story board layouts in Expression Blend. (See the note below for the workaround required to use VB &amp;amp; Blend.) 
&lt;LI&gt;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=89145&amp;amp;clcid=0x409" mce_href="http://go.microsoft.com/fwlink/?LinkID=89145&amp;amp;clcid=0x409"&gt;&lt;B&gt;Silverlight SDK&lt;/B&gt;:&lt;/A&gt; The most interesting content in the SDK is the reference documentation for the VB runtime. It basically details what functions and types in Microsoft.VisualBasic.dll. The download also includes samples, although I generally prefer to see them online here: &lt;A href="http://silverlight.net/quickstarts/managed.aspx" mce_href="http://silverlight.net/quickstarts/managed.aspx"&gt;http://silverlight.net/quickstarts/managed.aspx&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you run into any problems getting this stuff installed, please post the problem at the forums, &lt;A href="http://silverlight.net/forums/" mce_href="http://silverlight.net/forums/"&gt;http://silverlight.net/forums/&lt;/A&gt;. 
&lt;H3&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Calibri color=#17365d size=4&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;Workarounds&lt;/H2&gt;&lt;/FONT&gt;&lt;/H2&gt;&lt;/H3&gt;
&lt;P&gt;Okay, almost there… we just need to work around one somewhat confusing bug in Blend you’ll run into when you try to create a VB project: 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/Blend_Error%5B5%5D.png" mce_href="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/Blend_Error%5B5%5D.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=142 src="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/Blend_Error_thumb%5B1%5D.png" width=878 border=0 mce_src="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/Blend_Error_thumb%5B1%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;The problem here is that Expression Blend is configured to build VS 2005/VB 8.0 projects, but only VB 9.0 supports building Silverlight 1.1 applications. To work around the issue, you’ll have to re-configure Blend to use VS Orcas &amp;amp; VB 9.0 (Sigh!). Here’s how… 
&lt;OL&gt;
&lt;LI&gt;Close Microsoft Expression Blend. 
&lt;LI&gt;Navigate to \Program Files\Microsoft Expression\Blend 1.1\. 
&lt;LI&gt;Create a new XML file in that folder and then rename the file to Blend.exe.config. 
&lt;LI&gt;Paste the following XML snippet into Blend.exe.config. 
&lt;LI&gt;Save Blend.exe.config and close it.&amp;nbsp; 
&lt;LI&gt;Open Microsoft Expression Blend. Select “Visual Basic” as the language and you can create “Silverlight Application” projects. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Blend.exe.config&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;?&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;xml&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;version&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; =&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1.0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;?&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;configuration&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;startup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;supportedRuntime&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;version&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;v2.0.50727&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;safemode&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;requiredRuntime&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;version&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;v2.0.50727&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;safemode&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;startup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;runtime&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;assemblyBinding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;xmlns&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;urn:schemas-microsoft-com:asm.v1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;dependentAssembly&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&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;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;assemblyIdentity&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Microsoft.Build.Framework&lt;/FONT&gt;&lt;FONT size=2&gt;" &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;publicKeyToken&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;b03f5f7f11d50a3a&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;culture&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;neutral&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&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; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;bindingRedirect&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;oldVersion&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0.0.0.0-99.9.9.9&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;newVersion&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;3.5.0.0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&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;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;dependentAssembly&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;dependentAssembly&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&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; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;assemblyIdentity&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Microsoft.Build.Engine&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;publicKeyToken&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;b03f5f7f11d50a3a&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;culture&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;neutral&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;bindingRedirect&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;oldVersion&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0.0.0.0-99.9.9.9&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;newVersion&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;3.5.0.0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;dependentAssembly&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;assemblyBinding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;runtime&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;configuration&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just keep in mind that if you uninstall Orcas and you want to continue using Blend, you’ll need to delete Blend.exe.config. 
&lt;H3&gt;
&lt;H1 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Calibri color=#17365d size=5&gt;A lap around the tools&lt;/FONT&gt;&lt;/H1&gt;&lt;/H3&gt;
&lt;P&gt;You’re pretty much good to go at this point. With the installation of the Visual Studio Add-On, two new project types are available: a standalone Silverlight Web Application and Silverlight Class Library. 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/NewProjectDialog_Silverlight%5B2%5D.png" mce_href="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/NewProjectDialog_Silverlight%5B2%5D.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=345 src="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/NewProjectDialog_Silverlight_thumb.png" width=470 border=0 mce_src="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/NewProjectDialog_Silverlight_thumb.png"&gt;&lt;/A&gt; 
&lt;P&gt;I generally find the “Silverlight Project” the most useful template to work with. It includes basic XAML and VB code-behind files, Javascript goo required to instantiate the control, and a boilerplate HTML page that hosts the control. The project can be debugged by F5’ing TestPage.html, although Edit-and-Continue is not supported for Silverlight projects. &lt;B&gt;&lt;/B&gt;
&lt;P&gt;The programming model for Silverlight 1.1 is very similar to that of ASP.NET and WPF: the UI aspects of the control are declared in the .xaml file, and events are handled in the code-behind (.xaml.vb) file. Similar to desktop WPF, each named UI element declared in XAML has a corresponding variable that can be referenced in code-behind. 
&lt;P&gt;&amp;nbsp; &lt;A href="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/SolutionExplorer_Silverlight%5B4%5D.png" mce_href="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/SolutionExplorer_Silverlight%5B4%5D.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=188 src="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/SolutionExplorer_Silverlight_thumb%5B2%5D.png" width=240 border=0 mce_src="http://blogs.msdn.com/blogfiles/vbteam/WindowsLiveWriter/VBOnSilverlight_BD7A/SolutionExplorer_Silverlight_thumb%5B2%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;For example, the following TextBlock declared in Page.xaml… 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;lt;TextBlock x:Name="TextBlock1" Text="1234" /&amp;gt;&lt;/FONT&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can be referenced in Page.xaml.vb as follows… 
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Private Sub &lt;/SPAN&gt;TextBlock1_MouseEnter() &lt;SPAN style="COLOR: blue"&gt;Handles &lt;FONT color=#000000&gt;TextBlock1.MouseEnter&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0080ff&gt;&lt;SPAN style="COLOR: blue"&gt;Me&lt;/SPAN&gt;&lt;/FONT&gt;.TextBlock1.Opacity = 1&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;SPAN style="COLOR: blue"&gt;End Sub &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If you’re interested in checking out what’s available in the .NET Framework for Silverlight, you can poke around in the Add Reference dialog and/or Object Browser. The former is filtered to only show what you can use in Silvelight 1.1. 
&lt;P&gt;The Silverlight tools are very much in an Alpha state, so your mileage may vary a bit. In particular, debugging VB applications can be a somewhat bumpy ride… so please let us know on the &lt;A href="http://silverlight.net/forums/" mce_href="http://silverlight.net/forums/"&gt;forums&lt;/A&gt; if you run into any issues. 
&lt;H3&gt;Additional resources to check out&lt;/H3&gt;
&lt;P&gt;There are already some pretty vibrant community resources on Silverlight popping up. Many of these include sweet looking samples, and the amount of content should continue to grow in the coming months. The main place to keep an eye on is the &lt;A href="http://silverlight.net/" mce_href="http://silverlight.net/"&gt;main Silverlight site&lt;/A&gt; and the &lt;A href="http://silverlight.net/forums/" mce_href="http://silverlight.net/forums/"&gt;Silverlight forums&lt;/A&gt;. 
&lt;P&gt;By all means, feel free to share your impressions of VB on Silverlight. It’s early and we could really use the feedback. Thanks!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Joe &amp;amp; The VB Team&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2362539" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/Joe+Binder/default.aspx">Joe Binder</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>The Best of Intentions (Matt Gertz)</title><link>http://blogs.msdn.com/vbteam/archive/2007/04/30/the-best-of-intentions-matt-gertz.aspx</link><pubDate>Mon, 30 Apr 2007 19:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2343619</guid><dc:creator>VBTeam</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2343619.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2343619</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;The title pretty much describes this post.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I had fully intended to work on a Smart Device application for VB last week, and post the walkthrough here.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;VB is a great language for coding against devices, and there are a lot of cool things you can use a device for, so I was looking forward to a fun post on that this morning.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, I ended up needing to dig into some administrative work last week, and so I must apologize for not getting to the coding.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’m hoping that this current rush will wind down later this week, and I can refocus on a little app building.&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Times New Roman','serif'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The root cause of my personal administrative churn last week is simply that we’ve got a lot of exciting things going on right now!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We are now into the phase of the product that I like best; the phase that’s the most fun for me.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Some people like the design phase, others like the coding phase, but I personally dig the part where the features come together and we can see the scenarios start to work end-to-end.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’m always amazed at how a bunch of separate features planned by different teams can play so well together by the first beta, but this particular beta has been specifically pleasing in that regard.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Take a feature like Linq, for example.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The Linq features involve the C# team (both on the underlying DLinq DLLs and the C#-specific compiler &amp;amp; IDE Linq work), the VB team (both on the Compiler &amp;amp; IDE work as well as the designer work), and the XML team; the debugger teams are clearly impacted as well, as are any teams which produce products that support our languages such as the VS Tools for Office team and the Visual Web Designer team (among others).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The features have to install correctly, which involves the our setup team, and of course everything needs to work within the constraints of the .NET framework, the Core IDE, and SQL.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’ve joked with some of our customers that Linq is “the feature that ate our lives,” and in a sense, it’s true:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;it’s a lot of teams that have to keep their eyes on the prize for so many months to one degree or the other.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Despite this, the feature set feels very solid to me these days; a lot of great work has gone into the codebase, and the new engineering techniques &amp;amp; processes we’ve been using have been making a huge, positive, and noticeable impact . Getting all of the bits and pieces together for Beta 1 went so smoothly that it was almost eerie, thanks to the diligence of the teams involved.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri size=3&gt;The features themselves are of course fun to play with.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;VB is one of the larger teams in the division and thus my job of development manager is more “manager” than “development”--&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I rarely get my hands into the actual coding these days, beyond architectural discussions and the odd bug fix or two.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I compensate by filling in the gaps in my schedule with trying out all of the new features.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Having gotten used to the stability and usefulness of those new features in my office, I find myself automatically searching for these features when programming for fun at home, thus experiencing that momentary let-down when I realize I don’t have them available to me at home yet!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Ah, it’s hard to be patient…&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri size=3&gt;So, no fun tricks with VB2005 from me this week – I’ll try again next week.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;But, in the interim, you should know that things are looking *really* good here for Orcas!&amp;nbsp; I hope you enjoy trying out Beta1...&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;--Matt--*&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2343619" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/Matt+Gertz/default.aspx">Matt Gertz</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category></item><item><title>Visual Basic LINQ Samples Updated for Orcas Beta 1! (Beth Massi)</title><link>http://blogs.msdn.com/vbteam/archive/2007/04/20/visual-basic-linq-samples-updated-for-orcas-beta-1-beth-massi.aspx</link><pubDate>Fri, 20 Apr 2007 18:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2210172</guid><dc:creator>VBTeam</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2210172.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2210172</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;The &lt;A class="" href="http://msdn2.microsoft.com/en-us/vbasic/bb330936.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/vbasic/bb330936.aspx"&gt;Visual Basic LINQ Samples&lt;/A&gt; have been&amp;nbsp;updated for &lt;A class="" href="http://msdn2.microsoft.com/en-us/vbasic/aa700831.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/vbasic/aa700831.aspx"&gt;Visual Studio Orcas Beta 1&lt;/A&gt;! This is a set of 101 samples that demonstrate all the features of Visual Basic's Language Integrated Query in Orcas Beta 1.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Also check out the &lt;A class="" href="http://msdn2.microsoft.com/en-us/vbasic/aa904594.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/vbasic/aa904594.aspx"&gt;The LINQ Project page&lt;/A&gt;. This&amp;nbsp;has been updated with links to some news articles and quote highlights&amp;nbsp;&lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;that give an overview of the history of Microsoft's Language Integrated Query (LINQ) project, the reasons behind its development, and the benefits and features LINQ offers to developers. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;We’re&amp;nbsp;also continuing to update the main &lt;A class="" href="http://msdn.microsoft.com/vbasic" target=_blank mce_href="http://msdn.microsoft.com/vbasic"&gt;Visual Basic Developer Center&lt;/A&gt; with more content so check there often!&lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;-&lt;A class="" href="http://blogs.msdn.com/bethmassi/" target=_blank mce_href="http://blogs.msdn.com/bethmassi/"&gt;Beth Massi&lt;/A&gt;, Program Manager VS Core Community&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2210172" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Beth+Massi/default.aspx">Beth Massi</category></item><item><title>Visual Basic "Orcas" Beta1 is in the wild! (Amanda Silver)</title><link>http://blogs.msdn.com/vbteam/archive/2007/04/19/visual-basic-orcas-beta1-is-in-the-wild.aspx</link><pubDate>Thu, 19 Apr 2007 23:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2198795</guid><dc:creator>VBTeam</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2198795.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2198795</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Woohoo! Its &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/somasegar/archive/2007/04/19/visual-studio-orcas-and-net-fx-3-5-beta1-shipped.aspx" mce_href="http://blogs.msdn.com/somasegar/archive/2007/04/19/visual-studio-orcas-and-net-fx-3-5-beta1-shipped.aspx"&gt;&lt;FONT face=Calibri size=3&gt;official&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;, we finally got &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;&lt;FONT face=Calibri size=3&gt;Orcas Beta1&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; out the door! We’re very excited to get this release out to you so we can finally talk about some of the stuff we’ve been working on in addition to the LINQ and XML feature-set. We believe that Orcas Beta1 displays all of the essential value in the Orcas product but it’s important to keep in mind that it’s not feature-complete. There are many features (for example: lambda expressions, support for nullable types, etc.) that will be coming online in a later milestone. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;That said, back to Beta1! Recently, there’s been a lot of discussion on this blog about the LINQ features, but I’d like to take the time to discuss some of the language and compiler related features in Orcas Beta1 that will radically improve your productivity even if you don’t give a &lt;I style="mso-bidi-font-style: normal"&gt;hoot&lt;/I&gt; or &lt;I style="mso-bidi-font-style: normal"&gt;holler&lt;/I&gt; about the revolution in programming that we fondly call LINQ.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The first thing that’s going to jazz you is &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Intellisense Everywhere&lt;/I&gt;&lt;/B&gt;. In short, this feature is about providing statement completion suggestions at new points in your editing experience. Some examples are best shown as screen shots:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Expressions:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;IMG style="WIDTH: 479px; HEIGHT: 192px" height=192 src="http://blogs.msdn.com/photos/bethmassi/images/2199004/original.aspx" width=479 mce_src="http://blogs.msdn.com/photos/bethmassi/images/2199004/original.aspx"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Keywords:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;IMG src="http://blogs.msdn.com/photos/bethmassi/images/2199011/original.aspx" mce_src="http://blogs.msdn.com/photos/bethmassi/images/2199011/original.aspx"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Variable names:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;IMG src="http://blogs.msdn.com/photos/bethmassi/images/2199019/original.aspx" mce_src="http://blogs.msdn.com/photos/bethmassi/images/2199019/original.aspx"&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I’ll save the rest so as not to steal the thunder from another blogger on our team…. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Another great feature that you’ll notice in Beta1 is &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Relaxed Delegates&lt;/I&gt;&lt;/B&gt;. In short, relaxed delegates are a way to extend VB’s implicit conversions to delegate types. With relaxed delegates, you can write the following code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;Private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Button1_Click(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; sender &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Object&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; e &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; EventArgs) _&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Handles&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt; Button1.Click, Button1.MouseClick&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;MsgBox(&lt;SPAN style="COLOR: #a31515"&gt;"Do Something"&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;End&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;You can even omit *all* of the event arguments if your method body doesn’t need them. This improves readability without compromising type safety:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;Option&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt; &lt;SPAN style="COLOR: blue"&gt;Strict&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;On&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;Public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; Form1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; Button1_Click() &lt;SPAN style="COLOR: blue"&gt;Handles&lt;/SPAN&gt; Button1.Click, Button1.MouseClick&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;MsgBox(&lt;SPAN style="COLOR: #a31515"&gt;"Do Something"&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;End&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Lucida Console'; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Lastly, &lt;STRONG&gt;&lt;EM&gt;Multi-Targeting&lt;/EM&gt;&lt;/STRONG&gt; enables you to use Orcas Beta1 to write applications that target .NET 2.0, 3.0, or 3.5. This has been a long requested feature that is now in your hands. The idea is that by supporting multi-targeting, it’s a no-brainer to go out and pick up Orcas because it doesn’t necessarily require that you deploy a new runtime if you don’t use the features of .NET 3.5 – just your app. You can see this by going to File&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;à&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;New Project and changing the option in the dialog:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;IMG src="http://blogs.msdn.com/photos/bethmassi/images/2199016/original.aspx" mce_src="http://blogs.msdn.com/photos/bethmassi/images/2199016/original.aspx"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Hope these features find you well! &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;&lt;FONT face=Calibri size=3&gt;Download the Beta&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; and tell us what you think!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2198795" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/vbteam/attachment/2198795.ashx" length="233078" type="image/bmp" /><category domain="http://blogs.msdn.com/vbteam/archive/tags/Amanda+Silver/default.aspx">Amanda Silver</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/IDE/default.aspx">IDE</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/VB_5F00_Express/default.aspx">VB_Express</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category></item><item><title>"Live From Redmond: Orcas Overview" Webcast Rescheduled (Beth Massi)</title><link>http://blogs.msdn.com/vbteam/archive/2007/04/18/live-from-redmond-orcas-overview-webcast-rescheduled-beth-massi.aspx</link><pubDate>Thu, 19 Apr 2007 00:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2183116</guid><dc:creator>VBTeam</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2183116.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2183116</wfw:commentRss><description>&lt;P&gt;Live Meeting had some technical issues for this morning's webcast with John Stallo. Sincerest apologies from the Visual Basic team. We’ve rescheduled the webcast for this Tuesday, April 24th. &lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032338634%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target=_blank mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032338634%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;Please register here&lt;/A&gt;.&amp;nbsp;Also don't forget to register for the &lt;A class="" href="http://blogs.msdn.com/vbteam/archive/2007/04/09/live-from-redmond-webcast-series-beth-massi.aspx" target=_blank mce_href="http://blogs.msdn.com/vbteam/archive/2007/04/09/live-from-redmond-webcast-series-beth-massi.aspx"&gt;other incredible webcasts&lt;/A&gt; from other members of the team.&amp;nbsp;You can always find the latest information on all the webcasts on the &lt;A class="" href="http://msdn.microsoft.com/vbasic" target=_blank mce_href="http://msdn.microsoft.com/vbasic"&gt;Visual Basic Developer Center&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;-&lt;A class="" href="http://blogs.msdn.com/bethmassi/" target=_blank mce_href="http://blogs.msdn.com/bethmassi/"&gt;Beth Massi&lt;/A&gt;, Program Manager VS Core Community&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2183116" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Beth+Massi/default.aspx">Beth Massi</category></item><item><title>Live From Redmond Webcast Series (Beth Massi)</title><link>http://blogs.msdn.com/vbteam/archive/2007/04/09/live-from-redmond-webcast-series-beth-massi.aspx</link><pubDate>Mon, 09 Apr 2007 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2063277</guid><dc:creator>VBTeam</dc:creator><slash:comments>16</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/2063277.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=2063277</wfw:commentRss><description>&lt;P&gt;The &lt;A class="" href="http://blogs.msdn.com/vbteam/" target=_blank mce_href="http://blogs.msdn.com/vbteam/"&gt;Visual Basic team&lt;/A&gt; has put together a "Live from Redmond" webcast series aimed at the next version of Visual Basic and Visual Studio code named "Orcas". The live series starts April 18th and will continue to the end of May. Come join us for this exciting series direct from the &lt;A class="" href="http://blogs.msdn.com/vbteam/" target=_blank mce_href="http://blogs.msdn.com/vbteam/"&gt;Visual Basic team&lt;/A&gt;!! &lt;/P&gt;
&lt;P&gt;Here's the schedule (&lt;A class="" href="http://msdn.microsoft.com/vbasic" target=_blank mce_href="http://msdn.microsoft.com/vbasic"&gt;check the VB Developer Center for updates&lt;/A&gt;):&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032338634%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target=_blank mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032338634%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;Live From Redmond: VB9&amp;nbsp;- Orcas Overview&lt;/A&gt;&amp;nbsp;&lt;STRONG&gt;RESCHEDULED&lt;/STRONG&gt; April 24th, Presented by John Stallo&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332478%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target=_blank mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332478%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;Live From Redmond: VB9&amp;nbsp;-&amp;nbsp;LINQ Overview&lt;/A&gt;&amp;nbsp;April 25th, Presented by Kit George&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332483%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target=_blank mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332483%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;Live From Redmond: VB9 - LINQ to SQL &amp;amp; O/R Designer Deep Dive&lt;/A&gt;&amp;nbsp;May 2nd, Presented by Young Joo&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332485%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target=_blank mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332485%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;Live From Redmond: VB9 - Building N-Tier Applications&lt;/A&gt;&amp;nbsp;May 9th, Presented by Young Joo&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332487%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target=_blank mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332487%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;Live From Redmond: VB9 - Offline Data Caching&lt;/A&gt;&amp;nbsp;May 16th, Presented by Milind Lele&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332489%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target=_blank mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332489%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;Live From Redmond: VB9 - Deep Dive into LINQ&lt;/A&gt;&amp;nbsp;May 23rd, Presented by Amanda Silver&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032337103%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target=_blank mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032337103%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;Live From Redmond: VB9 - Building Service-Oriented Applications&lt;/A&gt;&amp;nbsp;May 30th, Presented by John Stallo&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE: The VB Team has added more webcasts for&amp;nbsp;June!&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class="" href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032337474&amp;amp;EventCategory=4&amp;amp;culture=en-US&amp;amp;CountryCode=US" target=_blank mce_href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032337474&amp;amp;EventCategory=4&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;Live From Redmond: Using the Interop Toolkit to Migrate your VB6 Applications to .NET&lt;/A&gt;&amp;nbsp;June 6th, Presented by Jonathan Aneja 
&lt;LI&gt;&lt;A class="" href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032332481&amp;amp;EventCategory=4&amp;amp;culture=en-US&amp;amp;CountryCode=US" target=_blank mce_href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032332481&amp;amp;EventCategory=4&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;Live From Redmond: VB9 – LINQ Best Practices&lt;/A&gt; June 13th, Presented by Lisa Feigenbaum&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Hope to see you at the webcasts! For more webcasts past, present and future, please visit the &lt;A class="" href="http://msdn2.microsoft.com/en-us/vbasic/aa727125.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/vbasic/aa727125.aspx"&gt;VB Webcasts page&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;-&lt;A class="" href="http://blogs.msdn.com/bethmassi/" mce_href="http://blogs.msdn.com/bethmassi/" minmax_bound="true"&gt;Beth Massi&lt;/A&gt;, Program Manager VS Core Community&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2063277" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/LINQ_2F00_VB9/default.aspx">LINQ/VB9</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Beth+Massi/default.aspx">Beth Massi</category></item><item><title>Partial Methods</title><link>http://blogs.msdn.com/vbteam/archive/2007/03/27/partial-methods.aspx</link><pubDate>Wed, 28 Mar 2007 04:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1971409</guid><dc:creator>VBTeam</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/1971409.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=1971409</wfw:commentRss><description>&lt;P&gt;About two weeks ago I had the opportunity to attend the product group dinner associated with the &lt;A href="https://mvp.support.microsoft.com/mvpsummit" mce_href="https://mvp.support.microsoft.com/mvpsummit"&gt;Global MVP Summit&lt;/A&gt; that was behind held here at Microsoft. Besides a free meal, this also gave me the excellent opportunity to meet with some of our &lt;A href="http://mvp.support.microsoft.com/mvpexecsum" mce_href="http://mvp.support.microsoft.com/mvpexecsum"&gt;MVPs&lt;/A&gt; and discuss their impressions with Visual Studio and all the cool new features we are introducing for Orcas. At the dinner, I had an opportunity to talk with a group of VB MVPS from Japan, who met with me and about 5 or 6 other members of the VB team. While we were talking, a couple of them asked me a few questions about partial methods. Unfortunately, I do not speak Japanese, and so had some trouble answering them. Figuring that written English may be easier to understand than my idiomatic spoken English, I decided to make Partial Methods the topic of my next blog post. &lt;/P&gt;
&lt;P&gt;As a result, I've included their questions below along with my answers. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What are Partial Methods?&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;In a nut-shell, partial methods are a light-weight replacement for events designed primarily for use by automatic code generators. They are declared by creating a private method with an empty body and decorating it with the &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;Partial&lt;/SPAN&gt; keyword. The method may then be "re-implemented" elsewhere within its containing class. If the method is implemented, then the compiler will redirect all calls to the partial method to the implementing method. If the method is not implemented in its containing class, then the compiler silently removes any calls to it from the program. They differ from events in several ways, mainly: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;A partial method can only have 1 "implementing method", where events may have any number of handlers &lt;/LI&gt;
&lt;LI&gt;The implementing method for a partial method must be in the same class as the partial method its self, where as event handlers can pretty much be defined in any type that has access to the event instance &lt;/LI&gt;
&lt;LI&gt;An event will throw if it has no handlers and is invoked. Usually this requires comparing the event against &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;Nothing&lt;/SPAN&gt; to safe guard against an exception. On the other hand, if a partial method does not have an implementing method then the compiler will simply optimize away any calls to it. &lt;/LI&gt;
&lt;LI&gt;The wiring of events is dynamic, which means that handlers can be added and removed from an event at runtime. This can either be done implicitly, using &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;WithEvents&lt;/SPAN&gt; variables and &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;Handles&lt;/SPAN&gt; clauses or explicitly using &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;AddHandler&lt;/SPAN&gt; and &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;RemoveHandler&lt;/SPAN&gt; statements. The wiring of partial methods, however, is always done at compile time, and an implementing method is associated with its declaring method by simply writing a method with the same name and signature as the partial method. Once this is done, all references to the partial method are rewritten by the compiler to refer to its implementing method. &lt;/LI&gt;
&lt;LI&gt;Events may be declared with any accessibility (public, private, or friend). Partial Methods, on the other hand must be private. The method that implements it, however, may have any accessibility. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;An example use of partial methods is shown below: &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Courier New"&gt;'Designer File &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;Partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; DesignerGeneratedClass &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;Partial Private Sub&lt;/SPAN&gt; OnFoo()&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;Partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Private Sub&lt;/SPAN&gt; OnBar() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; DoSomething() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;OnFoo() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;OnBar() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub &lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Courier New"&gt;'Code Behind File &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; DesignerGeneratedClass &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Overridable&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; OnFoo() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;Console.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Foo Occured"&lt;/SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub &lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Here we define a class named DesignerGeneratedClass split into two partial classes. It is designed to mimic typical code generation scenarios where one partial class contains designer generated code and another contains user generated code. For example, Windows Forms classes and pages in ASP.NET Web Application Projects utilize this approach. In the designer generated file we define a utility method, DoSomething, that calls two partial method declarations OnFoo and OnBar. The user file implements OnFoo, but not OnBar. When the VB compiler processes this class, it notices this and emits a body for DoSomething() that only calls OnFoo(). &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What are Partial Methods useful for?&lt;BR&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For most applications, events are almost always a better choice than partial methods due to their increased flexibility. However, there are some scenarios where they come in handy. A couple of them are listed below: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In automatic code generators &lt;BR&gt;&lt;BR&gt;Partial methods enable code generators to write extremely flexible code by creating a lot of "hooks", where developers can provide their own custom functionality that integrates into the "boiler plate" code created by the generator. Because the hooks are optimized away if they aren't used, no performance penalty is introduced by defining them. This is really useful if generated code needs to be used in high performance scenarios. For example, partial methods are used by the DLINQ designer for exactly this purpose. Developers wishing to invoke custom code on their data objects when properties are set can do so without requiring all users of DLINQ to suffer performance problems. &lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;To increase the readability of code that uses conditional compilation constants.&lt;BR&gt;&lt;BR&gt;Consider the following code that uses conditional compilation constants in VB.&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;BR&gt;Class&lt;/SPAN&gt; UglyConditonalCompilationCode&lt;BR&gt;&lt;BR&gt;#&lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; DEBUG &lt;SPAN style="COLOR: blue"&gt;Then&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; LogMessage(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; s &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;String&lt;/SPAN&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(s)&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;BR&gt;&lt;/SPAN&gt;#&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sub&lt;/SPAN&gt; DoStuff()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoFirstThing()&lt;BR&gt;#&lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; DEBUG &lt;SPAN style="COLOR: blue"&gt;Then&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage(&lt;SPAN style="COLOR: #a31515"&gt;"Did first thing"&lt;/SPAN&gt;)&lt;BR&gt;#&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoSecondThing()&lt;BR&gt;#&lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; DEBUG &lt;SPAN style="COLOR: blue"&gt;Then&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LogMessage(&lt;SPAN style="COLOR: #a31515"&gt;"Did second thing"&lt;/SPAN&gt;)&lt;BR&gt;#&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoThirdThing()&lt;BR&gt;#&lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; DEBUG &lt;SPAN style="COLOR: blue"&gt;Then&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage(&lt;SPAN style="COLOR: #a31515"&gt;"Did third thing"&lt;/SPAN&gt;)&lt;BR&gt;#&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;BR&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;This code is&amp;nbsp;obviously difficult to read. However, using partial methods it is possible to make the code much more readable:&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt; PrettyConditonalCompilationCode&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; LogMessage(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; s &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;String&lt;/SPAN&gt;)&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;#&lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; DEBUG &lt;SPAN style="COLOR: blue"&gt;Then&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; LogMessage(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; s &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;String&lt;/SPAN&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(s)&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;BR&gt;&lt;/SPAN&gt;#&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sub&lt;/SPAN&gt; DoStuff()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoFirstThing()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage(&lt;SPAN style="COLOR: #a31515"&gt;"Did first thing"&lt;/SPAN&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoSecondThing()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage(&lt;SPAN style="COLOR: #a31515"&gt;"Did second thing"&lt;/SPAN&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoThirdThing()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage(&lt;SPAN style="COLOR: #a31515"&gt;"Did third thing"&lt;/SPAN&gt;)&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;BR&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;BR&gt;&lt;STRONG&gt;Are Partial Methods Some Form Of AOP (Aspect Oriented Programming)? &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;No. Partial methods do share some things in common with Aspect Oriented Programming in that partial methods offer a way of associating "hooks" with custom code. However, unlike AOP systems partial methods require extension points to be explicitly defined by the customer. AOP systems allow developers to "weave in" functionality into code that hasn't had explicit hooks defined. Usually they do this by specifying some declarative search strings that describes the places where the hooks should be applied. The compiler is then responsible for finding all the appropriate "extension points" to apply the hooks to and injecting any necessary method calls. Partial methods in VB do not do this.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1971409" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/Scott+Wisniewski/default.aspx">Scott Wisniewski</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category></item><item><title>New Data Tools Features in Visual Studio Orcas </title><link>http://blogs.msdn.com/vbteam/archive/2007/03/13/new-data-tools-features-in-visual-studio-orcas.aspx</link><pubDate>Tue, 13 Mar 2007 18:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1874614</guid><dc:creator>VBTeam</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/vbteam/comments/1874614.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vbteam/commentrss.aspx?PostID=1874614</wfw:commentRss><description>&lt;P&gt;Here's a list of new data tools features in Visual Studio. I will be discussing each one in more detail in upcoming posts. &lt;/P&gt;
&lt;H3&gt;Object Relational Designer &lt;/H3&gt;
&lt;P&gt;The object relational mapping technology lets you map relational databases to objects. Once the mapping is done, you can manipulate mapped objects as normal objects and easily submit changes back to relational database without writing complex data access logic. It is the latest enhancement in data access technology and there are many different implementations out there currently. However, no O/R implementation comes with a graphical designer that makes it easy to create and modify mapping. &lt;/P&gt;
&lt;P&gt;The Object Relational Designer in Visual Studio is Microsoft's answer to how O/R mapping should be done. It's a graphical designer which lets you easily map database objects such as tables and stored procedures to LINQ To SQL classes and methods. You can just drag out database objects from the Database Explorer onto the designer. Designer then takes care of creating mapping and generating proper LINQ To SQL code. You can also modify different aspects of mapping through the designer and let the designer take care of updating the code automatically. Association and inheritance relationships can also be easily created easily. The stored procedure support is also a very unique feature. Instead of letting LINQ To SQL generate INSERT, UPDATE and DELETE SQL statements, you can map methods created based on the stored procedures to each behavior. &lt;/P&gt;
&lt;P&gt;If you've tried May CTP of LINQ, you probably remember a version of the O/R Designer we included. It was called DLinq Designer. What you see in &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=281fcb3d-5e79-4126-b4c0-8db6332de26e&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=281fcb3d-5e79-4126-b4c0-8db6332de26e&amp;amp;displaylang=en"&gt;March CTP of Visual Studio Orcas&lt;/A&gt; is the next generation of DLinq Designer and it's now called the O/R Designer. &lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 631px; HEIGHT: 399px" height=399 src="http://blogs.msdn.com/blogfiles/vsdata/WindowsLiveWriter/fe_2FE7/image%7B0%7D%5B18%5D.png" width=631 mce_src="http://blogs.msdn.com/blogfiles/vsdata/WindowsLiveWriter/fe_2FE7/image%7B0%7D%5B18%5D.png"&gt;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&amp;nbsp;&lt;/H2&gt;
&lt;H3&gt;Hierarchical Update in Typed Dataset &lt;/H3&gt;
&lt;P&gt;Keeping track of all inserts, updates and deletes across multiple related datatables and sending those changes in the right order back to the server is not an easy task. How do you make sure that new orders for your customer are added correctly to the system while updating the shipping address of the same customer and deleting one of old orders that had been cancelled all at the same time? &lt;/P&gt;
&lt;P&gt;With hierarchical update support in Typed Dataset, all you need to do is to call UpdateAll() method of the new TableAdapterManager component we've added. It takes care of collecting all changes and sending them back to the server in the right order. Of course, everything is wrapped into a transaction. &lt;/P&gt;
&lt;P&gt;We believe this would significantly improve the productivity of developers using Typed Dataset to create data applications. You can try this new feature in &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=281fcb3d-5e79-4126-b4c0-8db6332de26e&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=281fcb3d-5e79-4126-b4c0-8db6332de26e&amp;amp;displaylang=en"&gt;March CTP of Visual Studio Orcas&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://blogs.msdn.com/blogfiles/vsdata/WindowsLiveWriter/fe_2FE7/image%7B0%7D%5B35%5D.png" mce_src="http://blogs.msdn.com/blogfiles/vsdata/WindowsLiveWriter/fe_2FE7/image%7B0%7D%5B35%5D.png"&gt;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&amp;nbsp;&lt;/H2&gt;
&lt;H3&gt;N –Tier Support in Typed Dataset &lt;/H3&gt;
&lt;P&gt;I admit. Typed Dataset code we generate in Visual Studio 2005 is not N-Tier ready. If you open up the code file, you will notice that we've done a great job separating types from data access logic. Dataset and typed datatables are declared in one Typed Dataset class and all TableAdapter classes are declared under a separate namespace. But we generate both sets in one code file. For a lot of applications this is not an issue. But when you are building multi-tiered applications, having them in one file doesn't really help. This exact problem is discussed in detail on &lt;A href="http://blogs.msdn.com/smartclientdata/archive/2006/02/21/SeperatingTypedDataSetsFromTableAdapters.aspx" mce_href="http://blogs.msdn.com/smartclientdata/archive/2006/02/21/SeperatingTypedDataSetsFromTableAdapters.aspx"&gt;Splitting Typed Datasets from TableAdapters&lt;/A&gt; blog entry from Steve Lasker. The solution proposed in this blog entry was to open up the generated code and manually copy and paste type declaration out into a new class file. Although this did allow you to use Typed Dataset in N-Tier scenario, it had one major problem. Since you are manually modifying generated code, anytime you make a change to Typed Dataset via Dataset Designer, you have to remember to copy and paste code. That was painful. &lt;/P&gt;
&lt;P&gt;In Orcas, you can instruct the designer to generate Dataset portion of the code into another project in your solution. No more manual copy/paste. You can even make changes to Typed Dataset from the designer and it will make sure that updated code is generated into the specified project. You can still choose to stay in 2-Tier model. Designer will continue to generate everything in a single file. When you are ready to take your 2-Tier application to N-Tier, just tell the designer which project is the Dataset project and you are done. It's that simple. A preview of this feature is in &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=281fcb3d-5e79-4126-b4c0-8db6332de26e&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=281fcb3d-5e79-4126-b4c0-8db6332de26e&amp;amp;displaylang=en"&gt;March CTP of Visual Studio Orcas&lt;/A&gt; and you will be able to try the polished version in Beta 1. &lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://blogs.msdn.com/blogfiles/vsdata/WindowsLiveWriter/fe_2FE7/image%7B0%7D_thumb%5B12%5D.png" mce_src="http://blogs.msdn.com/blogfiles/vsdata/WindowsLiveWriter/fe_2FE7/image%7B0%7D_thumb%5B12%5D.png"&gt;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&amp;nbsp;&lt;/H2&gt;
&lt;H3&gt;Local Data Cache with SQL Compact Edition &lt;/H3&gt;
&lt;P&gt;SQL Compact Edition enables many exciting scenarios for developers. The most interesting scenario is to use SQL Compact Edition database file as a local cache of data that do not change often. For instance, your application might keep a list of products in local cache while exchanging order information with remote server. Once in a while, you can synch products list from the remote server but you will mostly use local cache. &lt;/P&gt;
&lt;P&gt;Since SQL CE is light-weight database that has very little overhead, it's the perfect candidate for the local cache store. You can use the Sync Service for ADO.NET to synchronize data between remote database server and local SQL CE database file. Sounds great, right? But how do you set everything up so that you can do this? &lt;/P&gt;
&lt;P&gt;Visual Studio Orcas includes new project item template "Local Data Cache". Adding "Local Data Cache" to your project creates .sync file which is an XML file that describes what gets synched and how. This file comes with the designer that lets you configure different aspects of synchronization easily. Designer also creates SQL CE .sdf database file to be used as local cache store as well as synchronization code necessary to interact with the Sync Service. A preview of this feature is in &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=281fcb3d-5e79-4126-b4c0-8db6332de26e&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=281fcb3d-5e79-4126-b4c0-8db6332de26e&amp;amp;displaylang=en"&gt;March CTP of Visual Studio Orcas&lt;/A&gt; and you will be able to try the polished version in Beta 1. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://blogs.msdn.com/blogfiles/vsdata/WindowsLiveWriter/fe_2FE7/image%7B0%7D%5B30%5D.png" mce_src="http://blogs.msdn.com/blogfiles/vsdata/WindowsLiveWriter/fe_2FE7/image%7B0%7D%5B30%5D.png"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Other Enhancements to Data Tools &lt;/H3&gt;
&lt;P&gt;Above four are major data tools features in Visual Studio Orcas. But there are tons of other enhancements we've made to existing data tools. I will be dedicating a separate post to describe other important enhancements we've made. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1874614" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vbteam/archive/tags/Data_5F00_Design/default.aspx">Data_Design</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/vbteam/archive/tags/Young+Joo/default.aspx">Young Joo</category></item></channel></rss>