<?xml-stylesheet type='text/xsl' href='http://blogs.u2u.be/rss.xsl' media='screen'?><rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0"><channel><title>U2U all posts</title><description /><item><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7374858</guid><link>http://weblogs.asp.net/jan/archive/2010/03/08/when-sharepoint-matters-oneresponse.aspx</link><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category><title>When SharePoint Matters: OneResponse</title><description>&lt;P mce_keep="true"&gt;Two weeks ago I was in Iceland, talking about SharePoint 2010 at &lt;A href="http://www.tmsoftware.is/english/" mce_href="http://www.tmsoftware.is/english/"&gt;TM Software&lt;/A&gt;&amp;nbsp;(&lt;A href="http://jantielens.wordpress.com/" mce_href="http://jantielens.wordpress.com/"&gt;some photos here :-)&lt;/A&gt; ). During the course, some students showed me a pretty cool public SharePoint 2007 site that they have been working on: OneResponse (&lt;A href="http://oneresponse.info/"&gt;http://oneresponse.info&lt;/A&gt;). OneResponse is the site the United Nations uses to collaborate and share information during catastrophes such as the recent earthquake in Haiti. Besides of the fact that the site is implemented really well, it must be pretty cool to know that your work will have such a big impact. Well done guys, it was a pleasure to be your guest!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7374858" width="1" height="1"&gt;</description><pubDate>Mon, 08 Mar 2010 20:52:00 Z</pubDate><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Tielens</dc:creator><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7374858</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2010/03/08/when-sharepoint-matters-oneresponse.aspx#comments</comments></item><item><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7371107</guid><link>http://weblogs.asp.net/jan/archive/2010/03/05/speaking-at-the-italian-sharepoint-conference-next-week.aspx</link><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category><title>Speaking at the Italian SharePoint Conference Next Week</title><description>&lt;P&gt;Next week on Wednesday and Thursday I’ll be in Milano, Italy during the &lt;A href="http://www.sharepointconference.it/" mce_href="http://www.sharepointconference.it"&gt;SharePoint &amp;amp; Office Conference 2010&lt;/A&gt;. They have a nice lineup of both Italian and international speakers to deliver 60 sessions during three days. I’ll be &lt;A href="http://www.sharepointconference.it/speakers.aspx#Jan_Tielens" mce_href="http://www.sharepointconference.it/speakers.aspx#Jan_Tielens"&gt;presenting four of them&lt;/A&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Client Side Technologies in SharePoint 2010&lt;/LI&gt;
&lt;LI&gt;Building, Deploying and Managing Sandboxed Solutions&lt;/LI&gt;
&lt;LI&gt;Advanced Web Part Development in SharePoint 2010&lt;/LI&gt;
&lt;LI&gt;Silverlight and SharePoint 2010: Better Together&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;So, please come and say hi if you’re on the SharePoint Conference in Italy next week!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7371107" width="1" height="1"&gt;</description><pubDate>Fri, 05 Mar 2010 11:15:00 Z</pubDate><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Tielens</dc:creator><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7371107</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2010/03/05/speaking-at-the-italian-sharepoint-conference-next-week.aspx#comments</comments></item><item><guid isPermaLink="false">http://blogs.u2u.be/diederik/post.aspx?id=eb057202-613e-476e-ba32-f922f8705e7b</guid><link>http://blogs.u2u.be/diederik/post/2010/03/04/How-to-play-the-Accordion-WPF-Toolkit.aspx</link><author>Diederik Krols</author><category>WPF</category><title>How to play the Accordion - WPF Toolkit</title><description>&lt;p&gt;The accordion is a musical instrument invented in Europe in the beginning of the 19th century. It produces music (or rather noise) by expanding and collapsing it while pressing buttons. This metaphor is applied to software: you may know the &lt;em&gt;Accordion&lt;/em&gt; user interface control from Microsoft Outlook's navigation bar. In the last couple of years the control appeared in an &lt;a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Accordion/Accordion.aspx"&gt;ASP.NET AJAX implementation&lt;/a&gt; and a &lt;a href="http://silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html"&gt;SilverLight implementation&lt;/a&gt;. Recently, the latter was ported to WPF and published as part of the &lt;a href="http://wpf.codeplex.com/releases/view/40535"&gt;February 2010 release of the WPF Toolkit&lt;/a&gt;. This article describes how to use this great WPF control.&lt;/p&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;The &lt;em&gt;Accordion&lt;/em&gt; is an &lt;em&gt;ItemsControl&lt;/em&gt; that allows you to provide multiple panes and expand them one at a time (well, by default). The items shown are instances of &lt;em&gt;AccordionItem&lt;/em&gt;. Clicking on a header will expand (actually 'select') or collapse the item's content. The &lt;em&gt;Accordion&lt;/em&gt; class carries the usual responsibilities of an &lt;em&gt;ItemsControl&lt;/em&gt;, like providing templates for header and content, and managing the selected items (plural, that is). On top of that, it supports the following extra properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;SelectionMode&lt;/em&gt;: One, OneOrMore, ZeroOrOne, or ZeroOrMore&lt;/li&gt;
&lt;li&gt;&lt;em&gt;ExpandDirection&lt;/em&gt;: Left, Right, Up, or Down&lt;/li&gt;
&lt;li&gt;&lt;em&gt;SelectionSequence&lt;/em&gt;: Simultaneous or CollapseBeforeExpand [I'm pretty sure that&amp;nbsp;this one doesn't work in the WPF version]&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Hello World&lt;/h2&gt;
&lt;p&gt;Let's go for a first test-drive. Download the toolkit, create a new WPF project, and add the following two references:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionReferences.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Register the namespace in your xaml:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then drop the following code in the window:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Accordion&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="Red"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Red"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="120"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="200" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="Orange"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Orange"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="120"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="200" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="Yellow"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Yellow"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="120"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="200" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="Green"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Green"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="120"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="200" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="Blue"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Blue"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="120"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="200" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="Indigo"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Indigo"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="120"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="200" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="Violet"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Violet"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="120"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="200" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Accordion&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You end up with sir Isaac Newton's 7 colors of the rainbow:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionIntro1.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;ExpandDirection&lt;/em&gt; property -unsurprisingly- changes the direction in which the items expand. Under the hood, a rotation transformation is applied to the header, so be careful when using images. This code:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Accordion&lt;/span&gt;&lt;span style="color: red;"&gt; ExpandDirection&lt;/span&gt;&lt;span style="color: blue;"&gt;="Right"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;will transform our accordion like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionIntro2.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;In some applications you may want to open an item just by hovering over its header, instead of clicking. This behavior doesn't come out of the box, but it's easy to implement: just register a handler for the &lt;em&gt;MouseEnter&lt;/em&gt; event for each &lt;em&gt;AccordionItem&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;C#&lt;/strong&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; AccordionItem_MouseEnter(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;MouseEventArgs&lt;/span&gt; e)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;AccordionItem&lt;/span&gt; item = sender &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;AccordionItem&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; item.IsSelected = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;XAML&lt;/strong&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Accordion&lt;/span&gt;&lt;span style="color: red;"&gt; ExpandDirection&lt;/span&gt;&lt;span style="color: blue;"&gt;="Right"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Accordion.Resources&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Style&lt;/span&gt;&lt;span style="color: red;"&gt; TargetType&lt;/span&gt;&lt;span style="color: blue;"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Type&lt;/span&gt;&lt;span style="color: red;"&gt; layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: blue;"&gt;}"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;EventSetter&lt;/span&gt;&lt;span style="color: red;"&gt; Event&lt;/span&gt;&lt;span style="color: blue;"&gt;="MouseEnter"&lt;/span&gt;&lt;span style="color: red;"&gt; Handler&lt;/span&gt;&lt;span style="color: blue;"&gt;="AccordionItem_MouseEnter" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Style&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Accordion.Resources&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;layoutToolkit&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;AccordionItem&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="Red"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Deeper dive&lt;/h2&gt;
&lt;p&gt;I decided to build a test application (or torture chamber) to figure out whether or not the control is ready to be used in a production application. An &lt;em&gt;Accordion&lt;/em&gt; is used a main navigation control, displaying more than just rectangles: a &lt;em&gt;TextBox&lt;/em&gt;, a picture library inspired by the rainbow accordion, a control with a variable height (a &lt;em&gt;TreeView&lt;/em&gt;), and a control that behaves badly in any WPF application (the WPF &lt;em&gt;WebBrowser&lt;/em&gt; is just a thin wrapper around the IE ActiveX). Here are a couple of screenshots:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionApp1.png" alt="" width="50%" /&gt; &lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionApp2png.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;h3&gt;Sizing&lt;/h3&gt;
&lt;p&gt;In their default style, the accordion and its items only occupy the space they need, so smaller content also shrinks the headers:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionUnstretched.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;That's why the main navigation accordion has its &lt;em&gt;HorizontalAlignment&lt;/em&gt; set to &lt;em&gt;Stretch&lt;/em&gt;. While the width of the main navigation accordion is fixed, its height will remain unpredictable - specifically if multiple items can be selected/expanded. A good old scrollbar will do:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionScrollBar.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;By the way, the size of an item doesn't change dynamically. In our sample application, the expansion of treeview items will just add a scrollbar, not push down the accordion's headers:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionTree1.png" alt="" width="30%" /&gt;&lt;/p&gt;
&lt;p&gt;Only when the same item is unselected and then reselected, the new height is applied:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionTree2.png" alt="" width="30%" /&gt;&lt;/p&gt;
&lt;p&gt;The picture library needs a more predictable behavior (fixed height and width), otherwise you end up with unacceptable looks - like a shrunk accordion, or headers being pushed out of sight:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionSmallPhoto.png" alt="" width="30%" /&gt; &lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionLargePhoto.png" alt="" width="30%" /&gt;&lt;/p&gt;
&lt;p&gt;Here's how to deal with this:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Style&lt;/span&gt;&lt;span style="color: red;"&gt; TargetType&lt;/span&gt;&lt;span style="color: blue;"&gt;="Image"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Setter&lt;/span&gt;&lt;span style="color: red;"&gt; Property&lt;/span&gt;&lt;span style="color: blue;"&gt;="Stretch"&lt;/span&gt;&lt;span style="color: red;"&gt; Value&lt;/span&gt;&lt;span style="color: blue;"&gt;="UniformToFill" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Setter&lt;/span&gt;&lt;span style="color: red;"&gt; Property&lt;/span&gt;&lt;span style="color: blue;"&gt;="Height"&lt;/span&gt;&lt;span style="color: red;"&gt; Value&lt;/span&gt;&lt;span style="color: blue;"&gt;="280" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Setter&lt;/span&gt;&lt;span style="color: red;"&gt; Property&lt;/span&gt;&lt;span style="color: blue;"&gt;="Width"&lt;/span&gt;&lt;span style="color: red;"&gt; Value&lt;/span&gt;&lt;span style="color: blue;"&gt;="400" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Style&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Styling&lt;/h3&gt;
&lt;p&gt;The application is styled through the very popular &lt;a href="http://www.codeplex.com/wpfthemes"&gt;WPF Themes&lt;/a&gt;, yet another port from SilverLight. Unfortunately the libraries don't contain styles for Toolkit controls (yet). The default styles for the &lt;em&gt;Accordion&lt;/em&gt; are not really innovative - the selected item gets the same style as the selected date in a &lt;em&gt;Calendar&lt;/em&gt; control:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionDefaultStyle.png" alt="" width="30%" /&gt;&lt;/p&gt;
&lt;p&gt;So download the WPF Toolkit's &lt;a&gt;source code&lt;/a&gt;, and copy-paste the relevant styles into a resource dictionary:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f3%2fAccordionStyling.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;These are the relevant styles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;AccordionButton&lt;/em&gt;: displays the animated arrow in the header,&lt;/li&gt;
&lt;li&gt;&lt;em&gt;ExpandableContentControl&lt;/em&gt;: displays the item's content,&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Accordion&lt;/em&gt;: displays the container,&lt;/li&gt;
&lt;li&gt;&lt;em&gt;AccordionItem&lt;/em&gt;: displays the item, basically a 2x2 grid, and&lt;/li&gt;
&lt;li&gt;&lt;em&gt;TransitioningContentControl&lt;/em&gt;: starts the animation when content changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now you have access to the whole look and feel of the control.&amp;nbsp;Just don't forget to register the resource dictionary in your XAML:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="color: red;"&gt; Source&lt;/span&gt;&lt;span style="color: blue;"&gt;="Themes\CustomAccordion.xaml" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Source Code&lt;/h2&gt;
&lt;p&gt;Here's the full source code of the sample project:&amp;nbsp;&lt;a href="http://blogs.u2u.be/diederik/file.axd?file=2010%2f3%2fU2UConsult.WPFToolkit.Accordion.Sample.zip"&gt;U2UConsult.WPFToolkit.Accordion.Sample.zip (1,98 mb)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Enjoy !&lt;/p&gt;</description><pubDate>Thu, 04 Mar 2010 16:35:00 -1300</pubDate><comments>http://blogs.u2u.be/diederik/post/2010/03/04/How-to-play-the-Accordion-WPF-Toolkit.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Diederik Krols</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/post.aspx?id=eb057202-613e-476e-ba32-f922f8705e7b</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/diederik/trackback.axd?id=eb057202-613e-476e-ba32-f922f8705e7b</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/post/2010/03/04/How-to-play-the-Accordion-WPF-Toolkit.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/syndication.axd?post=eb057202-613e-476e-ba32-f922f8705e7b</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=d8e6e674-1df0-4354-b372-31d6ffc7a3c4</guid><link>http://blogs.u2u.be/peter/post/2010/03/03/Team-System-2010-Easier-project-management-with-Team-Project-Collections.aspx</link><author>Peter Himschoot</author><category>Team System</category><category>VS2010</category><title>Team System 2010: Easier project management with Team Project Collections</title><description>&lt;p&gt;Team System 2010 introduces the concept of team project collections (TPC). A team project collection is, as it says, a collection of team projects, which can be managed individually. You can backup, move, delete, etc… each collection individually. Each collection will also have its unique work item ids, check sets, etc… Team project collections also change the way team foundation stores its stuff. Before it would use a bunch of databases, now everything connected is stored in a single database. One database per collection. You can easily find the database because it’s called Tfs_&amp;lt;CollectionName&amp;gt;. You ‘ll also find the Tfs_Configuration database containing all configured project collections (and depending on your installation a database for the analysis services).: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_160.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_160.png" width="148" height="59" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Project collections also solve a problem some of you might have encountered; TFS 2008 has an upper limit of 255 team projects. Now with TPC you just add another TPC when you reach the limit (I don’t know the limit of projects per collection, but I would assume it would be around the same…).&lt;/p&gt;  &lt;p&gt;A TPC can also easily be moved to another team server/farm, or to another SQL server on the same farm, as long as you keep it on the same type of SQL server (enterprise, express, …). Documentation states you cannot move it to another kind. The way to do this is to first open the Team Foundation Administration Console, and select the Team Projects Collections tree item. To the right you should see all your TPCs.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_161.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_161.png" width="644" height="371" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Here you can also create new TPC's, but that should be obvious.&lt;/p&gt;  &lt;p&gt;So to move a TPC you should first stop the collection. You’ll be asked for a reason:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_162.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_162.png" width="454" height="206" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And then you detach the collection:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_163.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_163.png" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Next you go through a verification step:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_164.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_164.png" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And then you click Complete:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_165.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_165.png" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now the TPC is no longer connected to TFS, but is still there in SQL server.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_166.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_166.png" width="188" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So now you detach the database in SQL server, move it to another SQL server or TFS farm. You might first need to restart a couple of services, such as the build service.&lt;/p&gt;  &lt;p&gt;So after attaching the database in SQL server, we now need to attach the database to TFS; go back to Team Foundation Administration Console, and click the “Attach Collection” button. Now choose your SQL server instance, and you’ll see all candidate databases:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_167.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_167.png" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hit Next if you want to change properties such as the name/description:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_168.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_168.png" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And next again to see an overview.&lt;/p&gt;  &lt;p&gt;So complete attaching, hit Verify to make sure everything is in order:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_169.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_169.png" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And then hit attach.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_170.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_170.png" width="644" height="484" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Eh voila!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_171.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_171.png" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now the TPC should be in the list:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_172.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_172.png" width="644" height="371" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can also split the projects in a single TPC to multiple TPCs (but not merge them, so be careful), but that will be for a later post.&lt;/p&gt;</description><pubDate>Wed, 03 Mar 2010 12:39:59 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/03/03/Team-System-2010-Easier-project-management-with-Team-Project-Collections.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=d8e6e674-1df0-4354-b372-31d6ffc7a3c4</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=d8e6e674-1df0-4354-b372-31d6ffc7a3c4</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/03/03/Team-System-2010-Easier-project-management-with-Team-Project-Collections.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=d8e6e674-1df0-4354-b372-31d6ffc7a3c4</wfw:commentRss></item><item><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7366447</guid><link>http://weblogs.asp.net/jan/archive/2010/03/01/scriptsrc-referencing-javascript-files-with-sharepoint-2010-custom-actions.aspx</link><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category><title>Referencing Javascript Files with SharePoint 2010 Custom Actions using SciptSrc</title><description>&lt;P mce_keep="true"&gt;If you’re an avid reader of this blog, you are probably aware of the fact that using Javascript plus SharePoint is a very powerful combination. In SharePoint 2007 there were a couple of techniques you could use to make sure your Javascript files would be referenced by SharePoint pages:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Add the Script reference to the Master Page&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Use a Delegate Control (e.g. the AdditionalPageHead)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Dynamically through code, e.g. in a Web Part&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;Although all those techniques work, and will still work in SharePoint 2010, they all have some limitations. The first technique requires you to build a custom Master Page, which may be a little overkill just to get a Javascript file referenced. Additionally, your custom Master Page is not used on Application Pages (unless you use the &lt;A href="http://www.codeplex.com/SuperBranding" mce_href="http://www.codeplex.com/SuperBranding"&gt;Superbranding trick&lt;/A&gt;). The second is my favorite one in SharePoint 2007, but the requirement is that the Master Page you’re using has the corresponding Delegate Control, and you need to have either a Server Control or Web User Control that generates HTML to reference the script. The third technique is nice if you only want to use the script when the Web Part is on the page, otherwise you’ll have to put the Web Part on every page where you’d like to reference the script.&lt;/P&gt;
&lt;P mce_keep="true"&gt;SharePoint 2010 is adding another very interesting technique to this list; using the &lt;STRONG&gt;ScriptSrc &lt;/STRONG&gt;attribute of the &lt;STRONG&gt;CustomAction &lt;/STRONG&gt;element in a Feature. Check the following Feature Elements file:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;Elements xmlns="&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;http://schemas.microsoft.com/sharepoint/&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;CustomAction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScriptSrc="&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;JSDemo/jquery-1.4.2.js&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Location="ScriptLink"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sequence="100"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/CustomAction&amp;gt;&lt;BR&gt;&amp;lt;/Elements&amp;gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;The first important thing to notice is that the CustomAction element contains the ScrptSrc attribute that points in this example to the jQuery Javascript library. The jQuery library is added to the &lt;STRONG&gt;/_layouts&lt;/STRONG&gt; folder in the SharePoint Root, in a folder called &lt;STRONG&gt;JSDemo &lt;/STRONG&gt;(the /_layouts/ prefix is added automatically). By the way, adding files to the /_layouts folder is very easy in a SharePoint project in Visual Studio 2010, using a &lt;STRONG&gt;Mapped Folder&lt;/STRONG&gt;.&amp;nbsp; The second important attribute is the Location; it must be set to ScriptLink so the Javascript file is referenced in the head element of the page. Optionally you can specify a Sequence attribute to determine the in which order the script references will be added (if you have multiple). When Feature is activated, it results in the following HTML:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;FONT face="courier new,courier"&gt;document.write('&amp;lt;script type="text/javascript" src="http://weblogs.asp.net/_layouts/jsdemo/jquery-1.4.2.min.js?rev=EAku7lY97C3Kgrd9LPWhrg%3D%3D"&amp;gt;&amp;lt;/' + 'script&amp;gt;');&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;It’s important to mention that adding a reference to a script using this technique only works for scripts stored in the /_LAYOUTS folder in the SharePoint Root, so unfortunately it’s not possible to do something like this:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;Elements xmlns="&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;http://schemas.microsoft.com/sharepoint/&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;CustomAction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScriptSrc="&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Location="ScriptLink"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sequence="100"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/CustomAction&amp;gt;&lt;BR&gt;&amp;lt;/Elements&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Besides the &lt;STRONG&gt;ScriptSrc&lt;/STRONG&gt; attribute, you can also use the &lt;STRONG&gt;ScriptBlock&lt;/STRONG&gt; attribute to render a script inline. The following example shows an annoying message box every time a pages load:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;lt;CustomAction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScriptSrc="JSDemo/jquery-1.4.2.min.js"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Location="ScriptLink"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sequence="100"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/CustomAction&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;CustomAction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Location="ScriptLink"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScriptBlock="$(document).ready(function() { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert('jQuery is loaded!!'); });"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sequence="101"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/CustomAction&amp;gt;&lt;BR&gt;&amp;lt;/Elements&amp;gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Unfortunately the ScriptSrc attribute doesn’t work very well in combination with Sandboxed Solutions: you can’t add files to the SharePoint Root using Sandboxed Solutions, and the ScriptSrc attribute requires the referenced script to be in the SharePoint Root’s /_layouts folder. I’m still figuring out a nice way to add for example the jQuery library to a SharePoint site, only using a Sandboxed Solution. If I’m successful, you’ll can definitely read more about it in a future post! :-)&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7366447" width="1" height="1"&gt;</description><pubDate>Mon, 01 Mar 2010 12:45:00 Z</pubDate><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Tielens</dc:creator><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7366447</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2010/03/01/scriptsrc-referencing-javascript-files-with-sharepoint-2010-custom-actions.aspx#comments</comments></item><item><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7366065</guid><link>http://weblogs.asp.net/jan/archive/2010/03/01/little-sharepoint-2010-gem-ajax-options-in-list-view-web-parts.aspx</link><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category><title>Little SharePoint 2010 Gem: AJAX Options in List View Web Parts</title><description>&lt;P mce_keep="true"&gt;Last week I stumbled upon some pretty neat functionality of the out-of-the-box List View Web Part in SharePoint 2010: the AJAX Options. When you add a Web Part from the &lt;STRONG&gt;List and Libraries &lt;/STRONG&gt;category (that basically shows you every List and Document Library you have on the SharePoint site) behind the scenes the Data View Web Part is being used to display the List or Document Library data.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://storage.tielens.name/ajaxoptions2.jpg" mce_src="http://storage.tielens.name/ajaxoptions2.jpg"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;When you edit such a Web Part once it has been added to a page, you’ll notice there is a new &lt;STRONG&gt;AJAX Options &lt;/STRONG&gt;section in the Web Part properties. AJAX stands for Asynchronous Javascript and XML and is a web development technique to build more interactive, rich web sites. The AJAX Options are disabled by default, but by enabling you can get some pretty cool results:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://storage.tielens.name/ajaxoptions1.png" mce_src="http://storage.tielens.name/ajaxoptions1.png"&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Enable Asynchronous Update&lt;/STRONG&gt;: enabling this option will make paging, sorting, filtering work without full page refreshes.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Show Manual Refresh Button&lt;/STRONG&gt;: enabling this option will show an icon to allow the user the refresh the data manually, once again without refreshing the rest of the page.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Enable Asynchronous Automatic Refresh&lt;/STRONG&gt;: when enabled, the Web Part will dynamically refresh the date it’s showing, without completely reloading the page. The interval can be specified in the textbox below.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Automatic Refreshing Interval&lt;/STRONG&gt;: specifies the interval used in the previous option.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Enable Asynchronous Load&lt;/STRONG&gt;: when enabled, the Web Part will initially be displayed without any data in it. But once the page is loaded, the Web Part will asynchronously fetch the data afterwards. When the data is being loaded, the Web Part will display an animation. This option will speed up the initial page load.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7366065" width="1" height="1"&gt;</description><pubDate>Mon, 01 Mar 2010 07:06:00 Z</pubDate><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Tielens</dc:creator><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7366065</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2010/03/01/little-sharepoint-2010-gem-ajax-options-in-list-view-web-parts.aspx#comments</comments></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=4668d177-a175-4fe4-be52-39735b73e73a</guid><link>http://blogs.u2u.be/peter/post/2010/02/28/When-being-lazy-is-(finally)-good.aspx</link><author>Peter Himschoot</author><category>VS2010</category><category>.NET Development</category><title>When being lazy is (finally) good</title><description>&lt;p&gt;In this blog post I want to talk about .NET 4 new Lazy&amp;lt;T&amp;gt; class. First of all, why would you need something called Lazy?&lt;/p&gt;  &lt;p&gt;You can use it for data access for example; when you load a row from a database parent table. Would you need to load the child rows automatically, or delay until they’re required. Some systems will delay load automatically, or load all they can (but what then when the child rows have other relations to grandchild rows, etc…). This kind of delayed loading of data is just what Lazy&amp;lt;T&amp;gt; (or Lazy(Of T) when using VB.NET) supports.&lt;/p&gt;  &lt;p&gt;It’s a great type to use when you have an object which is very expensive to create, and you only want to create it on first use. &lt;/p&gt;  &lt;p&gt;Let’s start with an example; let’s say you have this big-ass class:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BigAndExpensive&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s = &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetTheData()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   { &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; s; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; BigAndExpensive()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;BigAndExpensive is being created...&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 10000; i++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;       s = s + &lt;span style="color: #006080"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;BigAndExpensive is finally created...&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;As you can see, creating is very expensive (it will actually consume about 10 Gb of memory, triggering a lot of garbace collects).&lt;/p&gt;

&lt;p&gt;Let’s create an instance of this class without, then with Lazy&amp;lt;T&amp;gt; and look at the performance:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; BigAndExpensive be;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; Lazy&amp;lt;BigAndExpensive&amp;gt; lbe;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MeasureDuration(&lt;span style="color: #006080"&gt;&amp;quot;Not using Lazy evaluation&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   be = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BigAndExpensive();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MeasureDuration(&lt;span style="color: #006080"&gt;&amp;quot;Accessing non-lazy object's method&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s = be.GetTheData();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MeasureDuration(&lt;span style="color: #006080"&gt;&amp;quot;Using Lazy evaluation&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;   lbe = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Lazy&amp;lt;BigAndExpensive&amp;gt;(&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MeasureDuration(&lt;span style="color: #006080"&gt;&amp;quot;Accessing lazy object's method&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s = lbe.Value.GetTheData();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MeasureDuration(&lt;span style="color: #006080"&gt;&amp;quot;Again accessing lazy object's method&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s = lbe.Value.GetTheData();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In order to use the Lazy&amp;lt;T&amp;gt; object you have to get it’s value property. When the lazy loaded value hasn’t yet been created, accessing the Value will create it.&lt;/p&gt;

&lt;p&gt;The MeasureDuration class is a little timer taking advantage of the using statement:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; MeasureDuration : IDisposable&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   Stopwatch sw;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; what;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; MeasureDuration(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; what)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.what = what;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     sw = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Stopwatch();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     sw.Start();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Dispose()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     sw.Stop();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;     Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;Measured duration of -{0}- took {1} ticks ({2} ms)&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;                      , what, sw.ElapsedTicks, sw.ElapsedMilliseconds);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The output I get on machine looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_157.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_157.png" width="644" height="124" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;As you can see, creating a Lazy object is very fast, but of course as you can expect, using it the first time is just as expensive due to the creating process. Using it the second time is again very fast.&lt;/p&gt;

&lt;p&gt;Now go back to the code, and look for the Lazy&amp;lt;T&amp;gt; constructor. Change the false argument to true:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; lbe = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Lazy&amp;lt;BigAndExpensive&amp;gt;(&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This will make the instantiation process of the actual instance thread-safe. This means it will be a little slower, but only during construction. Is it worth the price? If you’re using multiple threads YES YES YES!&lt;/p&gt;

&lt;p&gt;Now let’s try to see what happens when many threads access an unprotected Lazy object (never be lazy AND unprotected :))&lt;/p&gt;

&lt;p&gt;This is the code:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; UsingLazyObjectsFromMultipleThreads()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   Lazy&amp;lt;BigAndExpensive&amp;gt; createMeOncePlease = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Lazy&amp;lt;BigAndExpensive&amp;gt;(isThreadSafe:&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;   ManualResetEvent youMayBegin = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ManualResetEvent(&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   AutoResetEvent done = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; AutoResetEvent(&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;   &lt;span style="color: #008000"&gt;// create a lot of threads that will use our object all at once&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     Thread t = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Thread(() =&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;       {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         youMayBegin.WaitOne();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;Thread {0} getting data&amp;quot;&lt;/span&gt;, Thread.CurrentThread.ManagedThreadId);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MeasureDuration(&lt;span style="color: #006080"&gt;&amp;quot;Multithreading&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;           createMeOncePlease.Value.GetTheData();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;         done.Set();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;       });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;     t.Start();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;   youMayBegin.Set();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;   &lt;span style="color: #008000"&gt;// wait for all threads to complete&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;     done.WaitOne();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I’ve now used the named argument feature of C# 4.0. In this case it make the code a lot clearer doesn’t it?&lt;/p&gt;

&lt;p&gt;So what does the code do. It creates 20 threads which all first wait for the “youMayBegin” event. This way all threads will start running at the same time. Then they each access the “createMeOncePlease” lazy instance, so some of them will start to create the instance (because it hasn’t yet been created). Then they will all signal that they’re done so the main thread can stop too.&lt;/p&gt;

&lt;p&gt;So let’s run the code (making sure the isThreadSafe is set to false). I get this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_158.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_158.png" width="633" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This is bad. Very bad. Instead of calling the constructor of my very expensive object once, it calls it several times. why?&lt;/p&gt;

&lt;p&gt;Think about lazy’s possible thread-unsafe implementation:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Lazy&amp;lt;T&amp;gt; &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; T : &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt;()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   T instance = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T Value&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     get&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (instance == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         instance = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; T();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; instance;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;When you run the if statement on multiple thread, each will evaluate to true, then each will create an object and overwrite instance’s value. &lt;/p&gt;

&lt;p&gt;So what is the solution? Simply pass true for the isThreadSafe argument.&lt;/p&gt;

&lt;p&gt;Running this code once more looks like this on my machine:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_159.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_159.png" width="546" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Good. My expensive object only get’s created once. But why are the calls soo expensive after all. That is because when we access Value, only one thread will be allowed to create the instance, but the other Value calls will need to wait for the first one to complete. If you insert another call using Value you’ll see the speed is very fast.&lt;/p&gt;

&lt;p&gt;If you only need initialization to be thread-safe, or only access to the object in a thread-safe you you can also use the contructor taking a LazyThreadSafetyMode enumeration:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; None = 0,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; PublicationOnly = 1,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; ExecutionAndPublication = 2&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;What if your expensive class requires special construction, like a special constructor? Then you can use another constructor of Lazy&amp;lt;T&amp;gt;, one that takes a delegate( Func&amp;lt;T&amp;gt; ) so you can create your object your way.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; Lazy&amp;lt;BigAndExpensive&amp;gt; createMeOncePlease = &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Lazy&amp;lt;BigAndExpensive&amp;gt;(() =&amp;gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BigAndExpensive());&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;</description><pubDate>Sun, 28 Feb 2010 15:50:19 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/02/28/When-being-lazy-is-(finally)-good.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=4668d177-a175-4fe4-be52-39735b73e73a</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=4668d177-a175-4fe4-be52-39735b73e73a</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/02/28/When-being-lazy-is-(finally)-good.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=4668d177-a175-4fe4-be52-39735b73e73a</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=e6c913a4-3e37-4e70-a8a6-2c6d1e6b6abf</guid><link>http://blogs.u2u.be/peter/post/2010/02/23/IntelliSense-improvements-in-Visual-Studio-2010.aspx</link><author>Peter Himschoot</author><category>VS2010</category><title>IntelliSense improvements in Visual Studio 2010</title><description>&lt;p&gt;What developer today can live without intelli-sense? Of course I mean developers who have used intelli-sense before (if you don’t know something how can you miss something?). However finding a member in Visual Studio 2008 requires you to know the first letters of the class/method/… I’m quite sure you sometimes now a class contains a certain word, but can’t remember the beginning. &lt;/p&gt;  &lt;p&gt;Now the new and improved intelli-sense in Visual Studio 2010 allows you to see any member containing a certain substring. For example when you type “opt”, you’ll get this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_152.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_152.png" width="296" height="222" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;But it even gets better. Try typing “AD”. Because .NET uses Pascal casing for all members, when you type the capital letters it will show you which members contain these same capital letters (and same order):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_153.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_153.png" width="293" height="260" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Love it! This also works in other places, for example in the Navigate To window!&lt;/p&gt;  &lt;p&gt;With following code, &lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; WebDeveloper&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Program&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Main(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] args)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     WebDeveloper dev1 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; WebDeveloper();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;opening the Navigate To window (use Ctrl-comma for example, and typing WD in the search box will show like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_155.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_155.png" width="644" height="407" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Oh, and selecting the WebDeveloper class will automatically highlight every other use of it:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_156.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_156.png" width="317" height="234" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Cool!&lt;/p&gt;

&lt;p&gt;And don’t you hate it when you start typing a method name you haven’t declared yet. By default Visual Studio will list a couple of suggestions, and when you commit (by pressing space of “(“) Visual studio inserts its own suggestion (and then you need to Undo (Ctrl-Z) to make Visual Studio keep whatever you were typing.&lt;/p&gt;

&lt;p&gt;So for example, when you have a variable s of type string, and then you type s.c intelli-sense will show the following. If you now press space, by default you’ll get s.Clone.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_154.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_154.png" width="334" height="165" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;But now you have auto-completion suggestion mode. In this case Visual Studio will not insert its own suggestion, but will keep your typing instead. &lt;/p&gt;

&lt;p&gt;If you do want to insert the suggested method, simply press TAB instead of space of open bracket. From now on this will be my default mode of working…&lt;/p&gt;</description><pubDate>Tue, 23 Feb 2010 22:06:51 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/02/23/IntelliSense-improvements-in-Visual-Studio-2010.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=e6c913a4-3e37-4e70-a8a6-2c6d1e6b6abf</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=e6c913a4-3e37-4e70-a8a6-2c6d1e6b6abf</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/02/23/IntelliSense-improvements-in-Visual-Studio-2010.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=e6c913a4-3e37-4e70-a8a6-2c6d1e6b6abf</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/kevin/post.aspx?id=de0e50c4-bb15-4e61-98ba-e5dbc46c3e65</guid><link>http://blogs.u2u.be/kevin/post/2010/02/15/Las-Vegas-MIXe28099ing-at-Microsoft-together-with-BESUG.aspx</link><author>kevin derudder</author><category>besug</category><category>silverlight</category><category>silverlight 3</category><category>microsoft</category><category>silverlight 4</category><title>Las Vegas MIX’ing at Microsoft together with BESUG</title><description>&lt;p&gt;MIX 2010 must be one of the best events Microsoft organizes for web folks. Since not everyone can make it to Las Vegas for this we at Microsoft Belgium together with the &lt;a href="http://www.besug.be" target="_blank"&gt;Belgian Silverlight User Group&lt;/a&gt; have a solution for you. We will organize a live keynote streaming on a big screen in a cool Vegas style. Expect a live intervention from some Belgians at MIX and cool prizes to be won.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;What’s on the agenda:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; 16h30 – Welcome   &lt;br /&gt;17h00 – 19h00 – Live keynote streamed from Las Vegas – don’t miss the announcements   &lt;br /&gt;19h00 – Break   &lt;br /&gt;19h30 – Live feed to some Belgians at MIX…   &lt;br /&gt;20h00 – American style light dinner   &lt;br /&gt;21h00 – Poker evening, prize draw   &lt;br /&gt;  &lt;br /&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/kevin/image.axd?picture=lasvegas_1.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="lasvegas" border="0" alt="lasvegas" src="http://blogs.u2u.be/kevin/image.axd?picture=lasvegas_thumb_1.jpg" width="337" height="254" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So hope to invite you all, please subscribe on following &lt;a href="http://tr.im/mix10 " target="_blank"&gt;link&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;K.&lt;/p&gt;</description><pubDate>Mon, 15 Feb 2010 15:11:19 -1300</pubDate><comments>http://blogs.u2u.be/kevin/post/2010/02/15/Las-Vegas-MIXe28099ing-at-Microsoft-together-with-BESUG.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">kevin derudder</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/kevin/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/kevin/post.aspx?id=de0e50c4-bb15-4e61-98ba-e5dbc46c3e65</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/kevin/trackback.axd?id=de0e50c4-bb15-4e61-98ba-e5dbc46c3e65</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/kevin/post/2010/02/15/Las-Vegas-MIXe28099ing-at-Microsoft-together-with-BESUG.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/kevin/syndication.axd?post=de0e50c4-bb15-4e61-98ba-e5dbc46c3e65</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=292ad650-e5fe-4d3d-a7ef-db983d2073b2</guid><link>http://blogs.u2u.be/peter/post/2010/02/07/Visual-Studio-2010-Release-Candidate-is-available-via-MSDN-sub-download.aspx</link><author>Peter Himschoot</author><title>Visual Studio 2010 Release Candidate is available via MSDN sub download</title><description>&lt;p&gt;Download VS2010 RC &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;And soon available for everyone tomorrow!&lt;/p&gt;</description><pubDate>Sun, 07 Feb 2010 23:21:06 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/02/07/Visual-Studio-2010-Release-Candidate-is-available-via-MSDN-sub-download.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=292ad650-e5fe-4d3d-a7ef-db983d2073b2</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">3</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=292ad650-e5fe-4d3d-a7ef-db983d2073b2</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/02/07/Visual-Studio-2010-Release-Candidate-is-available-via-MSDN-sub-download.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=292ad650-e5fe-4d3d-a7ef-db983d2073b2</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=fd08dd4f-c178-42e4-a976-342c40e61613</guid><link>http://blogs.u2u.be/peter/post/2010/02/05/Gated-Check-In-with-Multiple-Build-Definitions.aspx</link><author>Peter Himschoot</author><category>Team System</category><category>VS2010</category><category>.NET Development</category><title>Gated Check In with Multiple Build Definitions</title><description>&lt;p&gt;As promised in &lt;a href="http://blogs.u2u.be/peter/post/2010/02/05/Never-break-a-build-again-with-the-new-Gated-Check-in-feature-from-Visual-Studio-Team-System-2010.aspx" target="_blank"&gt;my previous blog on Gated Check In&lt;/a&gt;, in this blog I’ll discuss using multiple builds with gated check in.&lt;/p&gt;  &lt;p&gt;So what happens when you check in (using gated check in) and there are multiple build definitions targeting the solution? Well, Gated Check In will then allow you to choose between the different build definitions; for the moment Team Build does not allow you to filter the build definitions that are shown:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_151.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_151.png" width="554" height="334" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;In my example I’ve created a second build definition that doesn’t run tests, so you can select this one when you need to check in code without running tests…&lt;/p&gt;</description><pubDate>Fri, 05 Feb 2010 03:35:00 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/02/05/Gated-Check-In-with-Multiple-Build-Definitions.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=fd08dd4f-c178-42e4-a976-342c40e61613</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=fd08dd4f-c178-42e4-a976-342c40e61613</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/02/05/Gated-Check-In-with-Multiple-Build-Definitions.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=fd08dd4f-c178-42e4-a976-342c40e61613</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=af1d7e7e-b037-4f09-9a5c-6a317f4279f3</guid><link>http://blogs.u2u.be/peter/post/2010/02/04/Never-break-a-build-again-with-the-new-Gated-Check-in-feature-from-Visual-Studio-Team-System-2010.aspx</link><author>Peter Himschoot</author><title>Never break a build again with the new Gated Check-in feature from Visual Studio Team System 2010</title><description>&lt;p&gt;Breaking the current team build is not a good thing. This will cause many people to lose time while the build is being fixed. So how can you avoid this? One way is by only checking-in on isolated branches, which allow you first to test if everyone’s changes build together. &lt;/p&gt;  &lt;p&gt;But, remember that Team System Source Control has that one-click branching feature, called shelving? Well, now if you check in VSTS can take your changeset and merge it on a shelve with the current version in source control. It will then launch a build (using Team Build) and if this is a successful build (depends on the build) will allow you to check-in. &lt;/p&gt;  &lt;p&gt;Let’s have a look at this:&lt;/p&gt;  &lt;p&gt;To try this you first have to have something in Source Control. For example this simple library project and class:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Lib&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Code&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Test(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; i + j;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I’ve also added two unit tests in a test project:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [TestMethod()]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Test_2And3_Returns5()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   Code target = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Code(); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 2;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j = 3;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; expected = 5;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; actual;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;   actual = target.Test(i, j);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;   Assert.AreEqual(expected, actual);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt; [TestMethod()]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Test2And4Returns10()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;   Code target = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Code();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 2; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j = 4; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; expected = 6; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; actual;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;   actual = target.Test(i, j);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;   Assert.AreEqual(expected, actual);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Make sure all of this is currently checked in.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now go to Team Explorer, right-click on Builds and choose “New Build Definition…” The Build Definition dialog should open. Call your build GatedCheckIn (although the name doesn’t matter, I’ll be using it later).&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image3.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb11[1]" border="0" alt="image_thumb11[1]" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb11%5B1%5D_1.png" width="648" height="488" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now go the the Trigger tab; here is where the new Gated Check-in can be selected:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image7.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb31" border="0" alt="image_thumb31" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb31_1.png" width="648" height="488" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Next go to the Workspace tab, and select the folder containing your solution (both the library and test projects).&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image11.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb5" border="0" alt="image_thumb5" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb5_1.png" width="648" height="488" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Next come Build Defaults, the usual (you might need to create a shared folder so you can map to it here; make sure the Build Service account can access it):&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image15.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb7" border="0" alt="image_thumb7" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb7_1.png" width="648" height="488" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;I’ve left everything in the Process tab to its default value, but you might want to double check the Automated Tests. Team Build will run all tests in all assemblies whose name contains test.&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image19.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb9" border="0" alt="image_thumb9" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb9_1.png" width="647" height="488" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Also note the Fail Build On Test Failure setting; you can change it to true to ensure nobody can check-in with failing tests.&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image23.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb11" border="0" alt="image_thumb11" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb11_1.png" width="394" height="138" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;If you’re using the &lt;a href="http://blogs.u2u.be/peter/post/2010/01/19/Using-the-Visual-Studio-2010-layer-diagram-to-verify-your-solution.aspx" target="_blank"&gt;Layer Diagram&lt;/a&gt;, you can also validate it during the build.&lt;/p&gt;

&lt;p&gt;And finally Retention Policy, where you can choose whatever you like.&lt;/p&gt;

&lt;p&gt;Close the window and save your changes.&lt;/p&gt;

&lt;p&gt;You might want to test your build definition by queuing it. It should work:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image28.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb14" border="0" alt="image_thumb14" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb14_1.png" width="584" height="370" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Ok, now let’s make a change to our code that would break the build by failing one on the tests:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Lib&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Code&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Test(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; i - j;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I’ve simply changed to + sign into a – sign.&lt;/p&gt;

&lt;p&gt;Now open the Pending Changes window and click the Check In button. The Gated Check-in dialog should appear:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image32.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb16" border="0" alt="image_thumb16" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb16_1.png" width="561" height="340" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Note the Shelveset and Build definition. If you have more than one build definition, things change, we’ll look at this &lt;a href="http://blogs.u2u.be/peter/post/2010/02/06/Gated-Check-In-with-Multiple-Build-Definitions.aspx" target="_blank"&gt;later&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Also note the Preserve my pending changes locally. This works exactly the same way as normal shelving, so if you leave it checked, your changes are left on your machine. If the build fails, everything is the same. If you uncheck it, your changes will be shelved, but then you will have to make sure you reconcile back with the server’s version after the check in succeeds.&lt;/p&gt;

&lt;p&gt;Ok, Click the Build Changes button. A build should start. Open the Build Explorer if it doesn’t do so automatically:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image36.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb18" border="0" alt="image_thumb18" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb18_1.png" width="644" height="216" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The tests failed, so TFS decides that the check in failed:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image45.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb23" border="0" alt="image_thumb23" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb23_1.png" width="302" height="144" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image49.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb25" border="0" alt="image_thumb25" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb25_1.png" width="606" height="446" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Change the code back to use the + sign. Check In. This should now succeed.&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image52.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb26" border="0" alt="image_thumb26" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb26_1.png" width="248" height="117" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now this really become interesting if two developers check-in conflicting changes. We can emulate this using two workspaces. So I’ve setup another workspace mapped to the same project. To do this, go to Source Control Explorer and open the Workspace: drop-down list:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image41%5B1%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb1" border="0" alt="image_thumb1" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb1_1.png" width="345" height="105" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Select Workspaces…, this should open the Manage Workspaces dialog (you will have other names for any workspaces you might already have):&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image81.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb3" border="0" alt="image_thumb3" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb3_1.png" width="621" height="470" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now pick a name, and in the Working Folders select your project mapping, one for the server, one for on your disk. For example:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image12.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb51" border="0" alt="image_thumb51" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb51_1.png" width="628" height="490" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Then get all files locally (TFS will suggest this anyway). To switch between the workspaces you simply select it from the “Workspace:” dropdown list.&lt;/p&gt;

&lt;p&gt;In one workspace rename the Test method in the Code class to Add. Use the Rename feature to ensure all references are renamed as well… Run all tests, they should succeed. Don’t check in yet.&lt;/p&gt;

&lt;p&gt;Open your solution in the other workspace. Change the implementation of the Test method like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Code&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Test(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (j == 4) j = 8;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; i + j;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And change the unit tests as well:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [TestMethod()]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Test2And4Returns10()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   Code target = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Code();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 2; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j = 4; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; expected = 10; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; actual;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   actual = target.Test(i, j);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;   Assert.AreEqual(expected, actual);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Run all tests. They should succeed. Then check In. A build should start. While that is running check in your other changes (other workspace). Because your first check in is still running you shouldn’t see any conflict with your other changes. Actually, both builds should work, because the second build will merge the first build’s changes in the workspace, and they auto-Merge…&lt;/p&gt;

&lt;p&gt;Let’s try to really break it now. In one workspace add another method to call the Add method (reconcile the workspace first, or do a recursive get-latest version):&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Code&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Add(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (j == 4) j = 7;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; i + j;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OtherMethod()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;   {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; x = Add(3, 2);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Then in the other workspace rename the Add method again. Check this workspace in, then the other workspace. Because the extra method doesn’t get the Add method renamed, the build will break:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/Peter/AppData/Local/Temp/WindowsLiveWriter1286139640/supfilesD27F22F/image161.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image_thumb71" border="0" alt="image_thumb71" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb71_1.png" width="311" height="147" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Merge your code with the current check in code, and retry. This should now succeed.&lt;/p&gt;</description><pubDate>Thu, 04 Feb 2010 12:11:42 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/02/04/Never-break-a-build-again-with-the-new-Gated-Check-in-feature-from-Visual-Studio-Team-System-2010.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=af1d7e7e-b037-4f09-9a5c-6a317f4279f3</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=af1d7e7e-b037-4f09-9a5c-6a317f4279f3</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/02/04/Never-break-a-build-again-with-the-new-Gated-Check-in-feature-from-Visual-Studio-Team-System-2010.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=af1d7e7e-b037-4f09-9a5c-6a317f4279f3</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/diederik/post.aspx?id=f192c4d2-0831-44a6-a18d-4b8aff36e407</guid><link>http://blogs.u2u.be/diederik/post/2010/01/31/The-Missing-Linq-to-SQL-Spatial.aspx</link><author>Diederik Krols</author><category>SQL Server</category><category>Spatial</category><title>The Missing Linq to SQL Spatial</title><description>&lt;p&gt;This article provides hints and hacks on how to use the SQL Server spatial data types -Geography and Geometry- in Linq to SQL. The data provider has a problem&amp;nbsp;with serializing and deserializing the SQL UDT's. If you ever tried to use&amp;nbsp;these data types&amp;nbsp;in a Linq to SQL (or Entity Framework) project then you certainly encountered the following&amp;nbsp;error: &amp;ldquo;&lt;em&gt;One or more selected items contain a data type that is not supported by the designer&lt;/em&gt;&amp;rdquo;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Setting up a test environment&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I created a small database called 'Spatial' with a schema called 'Europe', and a table called 'Countries'. Here's the structure of the table:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CREATE TABLE &lt;/span&gt;[Europe].[Countries](&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CountryID] [int] &lt;span style="color: blue;"&gt;IDENTITY&lt;/span&gt;(1,1) &lt;span style="color: blue;"&gt;NOT NULL&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CountryName] [nvarchar](50) &lt;span style="color: blue;"&gt;NOT NULL&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Shape] [geography] &lt;span style="color: blue;"&gt;NOT NULL&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;CONSTRAINT &lt;/span&gt;[PK_Countries] &lt;span style="color: blue;"&gt;PRIMARY KEY CLUSTERED &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CountryID] &lt;span style="color: blue;"&gt;ASC&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;)&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;The source code that accompanies this article contains the scripts to create the assets and populate the table. Here's an indication of the table contents:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialssms.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;I created a Visual Studio 2008 Console application, and added a reference to &lt;em&gt;Microsoft.SqlServer.Types&lt;/em&gt;.&lt;em&gt; &lt;/em&gt;Then I added Linq to SQL classes (Europe.dbml). When I dropped the Europe.Counties table into the designer, the result was the expected error message:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatial_designer.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hint 1: Use views that cast the data type&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I decided to create a view in the schema: vw_Countries. It&amp;nbsp;exposes the same signature as the table, but with one difference: the shape column is returned as Varbinary(MAX) instead of Geography:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CREATE VIEW &lt;/span&gt;[Europe].[vw_Countries]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;CountryID&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ,CountryName&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ,&lt;span style="color: blue;"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: blue;"&gt;VARBINARY&lt;/span&gt;(&lt;span style="color: blue;"&gt;MAX&lt;/span&gt;), Shape) &lt;span style="color: blue;"&gt;AS &lt;/span&gt;Shape&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Europe.Countries&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The Geography UDT is physically stored as Varbinary(MAX) in SQL Server, so the table and the view are basically the same. There's one important difference though: Visual Studio is not allergic to the view. You can easily drag and drop it into the data model designer:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialview.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;p&gt;The Linq data provider delivers the varbinary data as &lt;em&gt;System.Data.Linq.Binary&lt;/em&gt;, but is -strangly enough- unable to convert this back to SqlGeography. It took me a while to figure out the conversion myself, but here's a working version:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;Binary&lt;/span&gt; belgiumb = (&lt;span style="color: blue;"&gt;from&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; db.vw_Countries&lt;/p&gt;
&lt;p style="margin: 0px;"&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; c.CountryID == 4&lt;/p&gt;
&lt;p style="margin: 0px;"&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; c.Shape).FirstOrDefault();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt; geo = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;geo.Read(&lt;span style="color: blue;"&gt;new&lt;/span&gt; System.IO.&lt;span style="color: #2b91af;"&gt;BinaryReader&lt;/span&gt;(&lt;span style="color: blue;"&gt;new&lt;/span&gt; System.IO.&lt;span style="color: #2b91af;"&gt;MemoryStream&lt;/span&gt;(belgiumb.ToArray())));&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hint 2: Package your conversion code&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We're going to get stuck with this type of conversions for a while, so it makes sense to wrap the calculations e.g. in extension methods. Here's an example:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Converts a Linq Binary to a SQL Server Geograpy.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;Throws an Exception if the Binary contains invalid data.&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt; AsGeography(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Binary&lt;/span&gt; binary)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (binary == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&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: #2b91af;"&gt;SqlGeography&lt;/span&gt;.Null;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt; result = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result.Read(&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;new&lt;/span&gt; System.IO.&lt;span style="color: #2b91af;"&gt;BinaryReader&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;new&lt;/span&gt; System.IO.&lt;span style="color: #2b91af;"&gt;MemoryStream&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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; binary.ToArray())));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; result;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So now I can call it like this:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt; b = (&lt;span style="color: blue;"&gt;from&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; db.vw_Countries&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;where&lt;/span&gt; c.CountryID == 4&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;select&lt;/span&gt; c.Shape).FirstOrDefault().AsGeography();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;" The area of Belgium is {0} m&amp;sup2;"&lt;/span&gt;, b.STArea().Value);&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hack 1: Change source mappings&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I wanted to execute my queries directly against the table. So I copy/pasted the view in the dbml, and modified the source mapping:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialhack1.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;p&gt;Now I can call the queries like this:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;belgium =&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt;.Parse((&lt;span style="color: blue;"&gt;from&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; db.Countries&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;where&lt;/span&gt; c.CountryID == 4&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;select&lt;/span&gt; c.Shape.ToString()).FirstOrDefault());&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hack 2: Change data type mappings&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since I wanted IntelliSense, I copy/pasted the Country table again, and changed the .NET type of the Shape property to SqlGeography:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialhack2.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;p&gt;The good news is: I now have IntelliSense at design time:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialintellisense.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;p&gt;The bad news is: I will have exceptions all over the place.&lt;/p&gt;
&lt;p&gt;If you return a spatial data type in the select, then a query is successfully constructed and sent to SQL Server, but the return values cannot be deserialized. Here's such a query:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;belgium = (&lt;span style="color: blue;"&gt;from&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; db.Countries2&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&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; c.CountryID == 4&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&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; c.Shape).FirstOrDefault();&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It results in a runtime exception:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatial4.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;p&gt;If you call a method -apart from ToString()- on a spatial data type in the where-clause, then you'll bump into a NotSupportedException already at compile time. Here's such a query:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; query = (&lt;span style="color: blue;"&gt;from&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; db.Countries2&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&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; (c.Shape.STArea() &amp;gt; 10).Value&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&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; c.CountryName).FirstOrDefault();&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And its result at compile time:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialnotsupported.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Intermezzo&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I tried to use Varbinary as data type for the _Shape backing variable, and SqlGeography as data type for the Shape property, and call conversions in the getter and setter. It didn't work: the getters and setters seem to be bypassed by the Linq provider.&lt;/p&gt;
&lt;p&gt;Conclusion: hack 2 was not a good idea. We'll stop using the Countries2 entity...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hint 3: Use scalar functions&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since STIntersects cannot be used, I created a scalar function that takes two Well-Known Texts, and returns whether or not the shapes intersect:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CREATE FUNCTION &lt;/span&gt;[Europe].[Intersects]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Shape1 &lt;span style="color: blue;"&gt;NVarchar&lt;/span&gt;(&lt;span style="color: blue;"&gt;MAX&lt;/span&gt;),&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Shape2 &lt;span style="color: blue;"&gt;NVarchar&lt;/span&gt;(&lt;span style="color: blue;"&gt;MAX&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;RETURNS integer&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@Geo1 Geography = geography::Parse(@Shape1)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@Geo2 Geography = geography::Parse(@Shape2)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;RETURN &lt;/span&gt;@Geo1.STIntersects(@Geo2)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;END&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Again, Visual Studio's designer has no problem with this, so you can drag and drop the function into the DataContext:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialintersects.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;p&gt;So you can use it in your queries:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; query = &lt;span style="color: blue;"&gt;from&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; db.Countries&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&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; db.Intersects(c.Shape.ToString(), belgium.ToString()) == 1&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&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; c.CountryName;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The response time seems to be good enough against such a small table. But I know that it is never a good idea to call functions in the where-clause of a query. It will force a table scan and an evaluation of the function for each row in the table. If you can live with the performance, then I suggest you just stick to this type of functions: they're highly reusable since they don't contain any hard-code table names.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hint 4: Use table valued functions&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If your geographical tables get bigger, it makes sense to define table valued functions or stored procedures to do the heavy lifting. The following example doesn't mask the usage of STIntersects in the where-clause, and may let SQL Server decide to use a spatial index (or you may even use a hint):&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CREATE FUNCTION &lt;/span&gt;[Europe].[Intersectors]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;(&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Shape &lt;span style="color: blue;"&gt;NVarchar&lt;/span&gt;(&lt;span style="color: blue;"&gt;MAX&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;RETURNS TABLE &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;RETURN &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;CountryID, CountryName&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Europe.Countries&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;Shape.STIntersects(geography::Parse(@Shape)) = 1&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;)&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And yes: I do realize that &lt;em&gt;Intersectors&lt;/em&gt; probable doesn't appear in a regular dictionary...&lt;/p&gt;
&lt;p&gt;Here's how&amp;nbsp;a call to it&amp;nbsp;looks like in Linq - we still have IntelliSense:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: azure;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; query = &lt;span style="color: blue;"&gt;from&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; db.Intersectors(belgium.ToString())&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&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; c.CountryName;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I couldn't keep myself from comparing the performance of the two functions. When I checked the actual query plans,my jaw hit the ground &lt;img title="Surprised" src="http://blogs.u2u.be/diederik/editors/tiny_mce3/plugins/emotions/img/smiley-surprised.gif" border="0" alt="Surprised" /&gt;, ouch! Completely against my expectation, the cost of the table value function was higher than the cost of the scalar function. And not just a little bit, but 5 times higher:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialplancost.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;Anyway, you should never blindly base your conclusions on just the query plans, so I started the SQL Profiler to inspect reality. After thorough testing I was relieved &lt;img title="Tongue out" src="http://blogs.u2u.be/diederik/editors/tiny_mce3/plugins/emotions/img/smiley-tongue-out.gif" border="0" alt="Tongue out" /&gt;. I observed that the tabled valued function&amp;nbsp;easily outruns the scalar version: it consumes between&amp;nbsp;3 and&amp;nbsp;8 times less CPU and returns the results&amp;nbsp;5 to 10&amp;nbsp;times faster. This is&amp;nbsp;actually an impressive difference for such a small table. Here's the result from a test session (scripts are included in the source code):&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialperf.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;p&gt;A negative aspect of this table valued function is its reusability: the function only works against the Europe.Countries table. If you need to query more tables with spatial data, then you need to add complexity to it, or start copy/pasting.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Conclusions&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The current Linq to Sql provider doesn't support the SQL Server spatial data types properly, so you have to be&amp;nbsp;creative if&amp;nbsp;you&amp;nbsp;want or need to use these.&amp;nbsp;It's not a waste of time to invest some effort in implementing the work arounds I suggested, and in optimizing and performance tuning these. Your solution will last for a while, since there seems to be no Microsoft solution on the horizon. The problems are not solved in SQL 2008 R2, Visual Studio 2010, or .NET 4.0.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Source code&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here's the source code for the test program. It also contains the necessary SQL scripts for creating and populating the entities, as well as for testing and performance tuning: &lt;a href="http://blogs.u2u.be/diederik/file.axd?file=2010%2f2%2fU2UConsult.DockOfTheBay.LinqToSpatialSample.zip"&gt;U2UConsult.DockOfTheBay.LinqToSpatialSample.zip (153,76 kb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here's how&amp;nbsp;its output should look like:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f2%2flinqtosqlspatialsample.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Credits&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I would like to thank my colleague &lt;a href="http://blogs.u2u.be/kris/"&gt;Kris Vandermotten&lt;/a&gt; for his input during the research.&lt;/p&gt;</description><pubDate>Sun, 31 Jan 2010 19:48:00 -1300</pubDate><comments>http://blogs.u2u.be/diederik/post/2010/01/31/The-Missing-Linq-to-SQL-Spatial.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Diederik Krols</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/post.aspx?id=f192c4d2-0831-44a6-a18d-4b8aff36e407</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/diederik/trackback.axd?id=f192c4d2-0831-44a6-a18d-4b8aff36e407</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/post/2010/01/31/The-Missing-Linq-to-SQL-Spatial.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/syndication.axd?post=f192c4d2-0831-44a6-a18d-4b8aff36e407</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=81c8f7ac-b9bb-4412-9286-cf413359a497</guid><link>http://blogs.u2u.be/peter/post/2010/01/29/Hiding-Showing-Jump-Lists-in-windows-7.aspx</link><author>Peter Himschoot</author><category>Windows 7</category><title>Hiding / Showing Jump Lists in windows 7</title><description>&lt;blockquote&gt;   &lt;p&gt;The jump list feature in Windows 7 makes it really easy to find the documents you were working on for each application. Just go to the taskbar and right-click the application. If your application has been enabled for jump lists (and they should, it is really easy to enable this using some API’s) then you should see a list of recently opened items. One day I started noticing I didn’t have any jump lists any more. Luckily the problem is easy to fix. Open your taskbar properties and go to the Start Menu tab. Check the “Store and display recently opened items in the Start menu and the taskbar” you you should get them back. I must have disabled this by accident…&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_131.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_131.png" width="437" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;</description><pubDate>Fri, 29 Jan 2010 07:03:21 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/01/29/Hiding-Showing-Jump-Lists-in-windows-7.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=81c8f7ac-b9bb-4412-9286-cf413359a497</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=81c8f7ac-b9bb-4412-9286-cf413359a497</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/01/29/Hiding-Showing-Jump-Lists-in-windows-7.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=81c8f7ac-b9bb-4412-9286-cf413359a497</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/diederik/post.aspx?id=62058e5f-8703-41f0-b134-bd547d034538</guid><link>http://blogs.u2u.be/diederik/post/2010/01/28/Converting-Spatial-Coordinates-with-ProjNET.aspx</link><author>Diederik Krols</author><title>Converting Spatial Coordinates with Proj.NET</title><description>&lt;p&gt;In &lt;a href="http://blogs.u2u.be/diederik/post/2010/01/13/SQL-Spatial-Tools-Map-Projections.aspx"&gt;my previous article&lt;/a&gt; I expressed some disappointment in the usefulness of the Map Projections in &lt;a href="http://sqlspatialtools.codeplex.com/"&gt;SQL Spatial Tools on CodePlex&lt;/a&gt;. There's not much you can do with these in a real-life application. Fortunately there's also &lt;a href="http://projnet.codeplex.com/"&gt;Proj.NET on CodePlex&lt;/a&gt;, a flexible advanced point-to-point coordinate conversion engine that is used internally by a lot of open source GIS projects.&lt;/p&gt;
&lt;p&gt;Here's a small fraction of its object model:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fprojnetcd.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Geographic Coordinate Systems&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The only predefined geographic coordinate system is WGS84:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;ICoordinateSystem&lt;/span&gt; gcs_WGS84 = &lt;span style="color: #2b91af;"&gt;GeographicCoordinateSystem&lt;/span&gt;.WGS84;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But you can easily create your own, from Well-Known Text (WKT) or through the object model:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; wkt_WGS84 =&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"GEOGCS[\"GCS_WGS_1984\","&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PRIMEM[\"Greenwich\",0],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"UNIT[\"Degree\",0.0174532925199433]"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"]"&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;ICoordinateSystem&lt;/span&gt; gcs_WGS84 = &lt;span style="color: #2b91af;"&gt;CoordinateSystemWktReader&lt;/span&gt;.Parse(wkt_WGS84) &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ICoordinateSystem&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Projected Coordinate Systems&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The only predefined projected coordinate system is UTM:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;IProjectedCoordinateSystem&lt;/span&gt; pcs_UTM31N = &lt;span style="color: #2b91af;"&gt;ProjectedCoordinateSystem&lt;/span&gt;.WGS84_UTM(31, &lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But again, you can easily create your own, from WKT or through an object model. Here's how Lambert 2008 -a local Belgian projection- looks like:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; wkt_Lam08 =&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PROJCS[\"ETRS89 / Belgian Lambert 2008\","&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"GEOGCS[\"ETRS89\","&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"DATUM[\"European Terrestrial Reference System 1989\","&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: #a31515;"&gt;"SPHEROID[\"GRS 1980\",6378137.0,298.257222101,"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"AUTHORITY[\"EPSG\",\"7019\"]],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: #a31515;"&gt;"TOWGS84[0.0,0.0,0.0,0.0,0.0,0.0,0.0],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: #a31515;"&gt;"AUTHORITY[\"EPSG\",\"6258\"]],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PRIMEM[\"Greenwich\",0.0,"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: #a31515;"&gt;"AUTHORITY[\"EPSG\",\"8901\"]],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"UNIT[\"degree\",0.017453292519943295],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"AXIS[\"Geodetic latitude\",NORTH],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"AXIS[\"Geodetic longitude\",EAST],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"AUTHORITY[\"EPSG\",\"4258\"]],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PROJECTION[\"Lambert Conic Conformal (2SP)\"],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PARAMETER[\"central_meridian\",4.359215833333335],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PARAMETER[\"latitude_of_origin\",50.79781500000001],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PARAMETER[\"standard_parallel_1\",49.833333333333336],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PARAMETER[\"false_easting\",649328.0],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PARAMETER[\"false_northing\",665262.0],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"PARAMETER[\"standard_parallel_2\",51.16666666666667],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"UNIT[\"m\",1.0],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"AXIS[\"Easting\",EAST],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"AXIS[\"Northing\",NORTH],"&lt;/span&gt; +&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;"AUTHORITY[\"EPSG\",\"3812\"]]"&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;IProjectedCoordinateSystem&lt;/span&gt; pcs_Lam08 =&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;CoordinateSystemWktReader&lt;/span&gt;.Parse(wkt_Lam08) &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IProjectedCoordinateSystem&lt;/span&gt;;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The list of supported projections includes Mercator, Transverse Mercator, Albers, Lambert Conformal, and Krovak.&lt;/p&gt;
&lt;p&gt;If you download the project's &lt;a href="http://projnet.codeplex.com/SourceControl/list/changesets"&gt;source code&lt;/a&gt;, you'll also discover an SRIDReader class that allows you to instantiate a coordinate system from nothing more than its &lt;a href="http://en.wikipedia.org/wiki/SRID"&gt;Spatial Reference ID&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Transformations&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A coordinate conversion can be defined and called through the API as follows:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;CoordinateTransformationFactory&lt;/span&gt; ctfac = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CoordinateTransformationFactory&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;ICoordinateTransformation&lt;/span&gt; trans = ctfac.CreateFromCoordinateSystems(gcs_WGS84, pcs_UTM31N);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;[] fromPoint = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: blue;"&gt;double&lt;/span&gt;[] { 4.296545, 50.880324 };&amp;nbsp; &lt;span style="color: green;"&gt;// U2U Consult Head Office, in degrees&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;[] toPoint = trans.MathTransform.Transform(fromPoint);&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you're lucky, then you also get the inverse transformation, but it's not always implemented.&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;IMathTransform&lt;/span&gt; inversedTransform = trans.MathTransform.Inverse();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;double&lt;/span&gt;[] point = inversedTransform.Transform(toPoint);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;NotImplementedException&lt;/span&gt; ex)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Your exception handling here...&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;Test Client&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Here are U2U Consult's Headquarter's coordinates:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fU2UConsult_Coordinates.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;I built a small test client that applies some transformations on these (WGS 84 - UTM - Lambert 1972 - Lambert 2008). Here's how the result looks like:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fprojnetclient.png" alt="" width="25%" /&gt;&lt;/p&gt;
&lt;p&gt;For the sake of completeness: here's the full source code: &lt;a href="http://blogs.u2u.be/diederik/file.axd?file=2010%2f1%2fProjNetClient.zip"&gt;ProjNetClient.zip (38,93 kb)&lt;/a&gt;&lt;/p&gt;</description><pubDate>Thu, 28 Jan 2010 20:52:00 -1300</pubDate><comments>http://blogs.u2u.be/diederik/post/2010/01/28/Converting-Spatial-Coordinates-with-ProjNET.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Diederik Krols</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/post.aspx?id=62058e5f-8703-41f0-b134-bd547d034538</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/diederik/trackback.axd?id=62058e5f-8703-41f0-b134-bd547d034538</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/post/2010/01/28/Converting-Spatial-Coordinates-with-ProjNET.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/syndication.axd?post=62058e5f-8703-41f0-b134-bd547d034538</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=a622bc88-4564-4aa5-9016-e1f0a9cbf354</guid><link>http://blogs.u2u.be/peter/post/2010/01/26/Techdays-2010.aspx</link><author>Peter Himschoot</author><category>.NET Development</category><category>VS2010</category><category>WCF</category><category>WF 4</category><title>Techdays 2010</title><description>&lt;p&gt;I’m happy to say I’ll be speaking at &lt;a href="http://www.microsoft.com/belux/techdays/2010/" target="_blank"&gt;TechDays 2010&lt;/a&gt; in Belgium and DevDays 2010 in the &lt;a href="http://www.devdays.nl/Default.aspx?pid=72&amp;amp;lang=nl" target="_blank"&gt;Netherlands&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In Belgium I’ll be doing one session on “What is new in WCF 4” and one session on “Workflow Foundation 4”.&lt;/p&gt;  &lt;p&gt;In the Netherlands I’ll do on session on “What is new in WCF4” and one on “Developing for Windows 7 with the Windows API code pack”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=Speaker_180x150.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Speaker_180x150" border="0" alt="Speaker_180x150" src="http://blogs.u2u.be/peter/image.axd?picture=Speaker_180x150_thumb.jpg" width="184" height="154" /&gt;&lt;/a&gt; &lt;a href="http://blogs.u2u.be/peter/image.axd?picture=Peter.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Peter" border="0" alt="Peter" src="http://blogs.u2u.be/peter/image.axd?picture=Peter_thumb.png" width="123" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 26 Jan 2010 10:46:39 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/01/26/Techdays-2010.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=a622bc88-4564-4aa5-9016-e1f0a9cbf354</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=a622bc88-4564-4aa5-9016-e1f0a9cbf354</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/01/26/Techdays-2010.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=a622bc88-4564-4aa5-9016-e1f0a9cbf354</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=93295154-66a3-45d7-9723-c56d8c6e0caa</guid><link>http://blogs.u2u.be/peter/post/2010/01/24/Planning-Running-and-measuring-tests-with-Visual-Studio-2010-Ultimate-and-Test-and-Lab-Manager.aspx</link><author>Peter Himschoot</author><category>VS2010</category><category>Team System</category><category>.NET Development</category><title>Planning, Running and measuring tests with Visual Studio 2010 Ultimate and Test and Lab Manager</title><description>&lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;So what does Visual Studio 2010 bring for testers? A whole lot! Especially the new test environment, where you can create a test plan to validate the quality of the software you’re building. A test plan is a collection of test cases, which you can then run. While running the system keeps track of a whole lot of things, including code coverage and &lt;a href="http://blogs.u2u.be/peter/post/2010/01/25/Using-the-Visual-Studio-2010-Historical-Debugger-to-save-and-reproduce-bugs.aspx" target="_blank" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;IntelliTrace&lt;/a&gt; information. And finally this application allows you to examine the combined results of all tests, to see how your development effort is doing.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;So again: A test plan is a collection of test suites, used to test a certain iteration in your project. A test suite is a collection of test cases to test a certain part of your project, and a test case is a test for a project feature. A test case is basically an UI test running in a specific environment. To model this, Test and Lab manager also allows you to define a test configuration, which is a certain environment for your code, for example Windows 7 with IE8, or Windows XP SP2 with IE7.&lt;/p&gt;  &lt;h2 insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Running Test and Lab Manager&lt;/h2&gt;  &lt;blockquote insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;   &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;First time you run this application it will ask for your Team Foundation Server (TFS) and after that, for the Project Collection and Team Project:&lt;/p&gt;    &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_110.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_110.png" width="232" height="128" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Ok, next step it will ask you for a test plan; since there are none you will have to create a new one:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_111.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_111.png" width="518" height="446" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Then click “Select plan &amp;gt;”.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;This opens the test plan.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_112.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_112.png" width="644" height="457" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;if you want you can change some of the properties of this test plan by clicking on the properties tab:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_113.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_113.png" width="644" height="455" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Here you can change the iteration for example, or the test settings.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_114.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_114.png" width="468" height="95" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;blockquote insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;   &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;With &lt;a href="http://msdn.microsoft.com/en-us/library/dd286743(VS.100).aspx" target="_blank" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;test settings&lt;/a&gt; you can change how your tests will be executed. For example in the Local Test Run settings you can change the diagnostic data adapter, which record data from your test run. For example is you want an action recording, event log entries, etc… You can also use it to emulate certain environments, for example running low on memory. You can even create your own data adapter.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_115.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_115.png" width="585" height="265" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;This first page allows you to change the name, and choose between running a manual or automated test.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_116.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_116.png" width="644" height="297" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;On the second page you can define the roles. You define a role for each tier to use to run tests and collect data. One the local settings you can only have one role, your own physical machine. If you want to use roles, you will also have to define environments.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_117.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_117.png" width="644" height="360" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Here you can define what kind of data you want to gather. For example, the Action Recording will record each action taken during the test, making it easy for another person (typically a developer) to understand what happened during running the test. The Action log is a text version of the recording. &lt;a href="http://blogs.u2u.be/peter/post/2010/01/25/Using-the-Visual-Studio-2010-Historical-Debugger-to-save-and-reproduce-bugs.aspx" target="_blank" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;IntelliTrace&lt;/a&gt; will allow a developer to load the IntelliTrace log and step back in the code, to see how the error came to be.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Go back to the Contents tab.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Now we’re ready to test some of our user stories (from now on I will be using User Stories, but this could just as easily be called a requirement or anything else to denote a certain needed functionality of your software system). Test cases are grouped into test suites. Per test plan you have a default test suite, but you can also create a test suite for a specific user story, copy a test suite from another test plan, create a nested suite or create one from a query:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_118.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_118.png" width="314" height="297" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;If you select “Add requirement&amp;quot;to plan” you will need to select a user story. This user story is now associated with this test suite. This will allow reporting to figure out which tests have ran for which user story.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_119.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_119.png" width="644" height="203" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Now we’re ready to add a test case, so click the New button. The New Test Case dialog should show:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_120.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_120.png" width="644" height="454" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Add the four steps (please note that we’re doing this for the sake of the demo, normally your requirement should not be to crash :) ). Save it.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Click on the Tested User Stories tab: the User Story should be there. Save and Close.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;A couple of other things you can now do is to assign it to a tester, and/or change the configurations:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_121.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_121.png" width="617" height="174" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Let’s run the test. First open the Test tab: &lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_122.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_122.png" width="328" height="63" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;From here you can see all test cases for a test suite:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_123.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_123.png" width="644" height="165" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Select the test case and click on the run button. The Test Runner should open:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_124.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_124.png" width="436" height="358" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Check the Create action recording button and hit Start Test. Do as the test case says, and try to use a repeatable way to start the application (for example using the start menu). The first and second step should not be a problem, so click the drop down boxes to the right of each step to indicate success:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_125.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_125.png" width="443" height="365" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Now make the third step fail. You’ll need to enter a comment why it failed. Then click the End Test hyperlink button. You’ll see test center gather some information.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;On top of the test runner window you’ll see a toolbar. Click on the Create Bug button:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_126.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_126.png" width="618" height="484" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;You’ll see that most of the fields are automatically filled in. You might want to change the Severity for example, and maybe assign it to a certain tester, but that is all… Click Save. Check out the information included in the System Info, and All Links tab. Close it.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Remember me asking you to start the application using some repeatable way? Well, try and click on the play button. Your test should replay again. This makes it easier to re-test later.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Coming back to Test and Lab Manager. The test case failed so now the UI updates to show this:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_127.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_127.png" width="644" height="188" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;If you have more than one test, the bar will color depending on how many succeeded, failed or are still in progress.&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Later you can come back and verify if a bug still exists by using the Verify Bugs tab:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_128.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_128.png" width="644" height="155" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Go back to the Plan tab, then open the properties. Now you should see an overview:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_129.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_129.png" width="644" height="443" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;Back to Visual Studio, so close the Test and Lab Manager. Go to the Team Explorer and open the My Bugs query. You should see the bug we created before. Open it:&lt;/p&gt;  &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_130.png" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_130.png" width="557" height="484" insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;blockquote insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt;   &lt;p insertadjacenthtml="function(loc, code)&amp;#13;&amp;#10;                    {&amp;#13;&amp;#10;                        // HTML Content changing..&amp;#13;&amp;#10;                        _baseInsertFunction(loc, code);&amp;#13;&amp;#10;&amp;#13;&amp;#10;                        try&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                            vsttTrackHover.NodeAddition();&amp;#13;&amp;#10;                            vsttTrackHover.OverrideNodes(domElement.parentNode.all, 0);&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                        catch (ex)&amp;#13;&amp;#10;                        {&amp;#13;&amp;#10;                        }&amp;#13;&amp;#10;                    }" __vsttTracked="1"&gt; Go to All Links, and open the IntelliTrace log (.tdlog). With it you can now replay the bug, just like in my previous post on IntelliTrace. If this doesn’t work, go back to the test settings. You might also like the Video feature, so you can replay the user’s actions!&lt;/p&gt;&lt;/blockquote&gt;</description><pubDate>Sun, 24 Jan 2010 02:27:24 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/01/24/Planning-Running-and-measuring-tests-with-Visual-Studio-2010-Ultimate-and-Test-and-Lab-Manager.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=93295154-66a3-45d7-9723-c56d8c6e0caa</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=93295154-66a3-45d7-9723-c56d8c6e0caa</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/01/24/Planning-Running-and-measuring-tests-with-Visual-Studio-2010-Ultimate-and-Test-and-Lab-Manager.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=93295154-66a3-45d7-9723-c56d8c6e0caa</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/peter/post.aspx?id=48b3227a-1b45-4b21-9fc3-95fd169f6ca1</guid><link>http://blogs.u2u.be/peter/post/2010/01/23/Using-the-WPF-Visualizer-in-Visual-Studio-2010.aspx</link><author>Peter Himschoot</author><category>VS2010</category><category>WPF/Silverlight</category><title>Using the WPF Visualizer in Visual Studio 2010</title><description>&lt;p&gt;Visual Studio 2010 now has a cool little feature I want to show you. When you’re debugging WPF applications, you sometimes need to see the controls and their hierarchy. Now with VS2010 this is easy. Simply use the magnifying class (the visualizer feature) and select the WPF Tree Visualizer:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_108.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_108.png" width="644" height="183" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;This will show you all the controls with their properties like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.u2u.be/peter/image.axd?picture=image_109.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.u2u.be/peter/image.axd?picture=image_thumb_109.png" width="644" height="429" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;In the left pane you get the tree view of controls with a rendering of the selected control, at the right side you get all properties of the control.&lt;/p&gt;</description><pubDate>Sat, 23 Jan 2010 21:18:02 -1300</pubDate><comments>http://blogs.u2u.be/peter/post/2010/01/23/Using-the-WPF-Visualizer-in-Visual-Studio-2010.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Himschoot</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/peter/post.aspx?id=48b3227a-1b45-4b21-9fc3-95fd169f6ca1</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/peter/trackback.axd?id=48b3227a-1b45-4b21-9fc3-95fd169f6ca1</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/post/2010/01/23/Using-the-WPF-Visualizer-in-Visual-Studio-2010.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/peter/syndication.axd?post=48b3227a-1b45-4b21-9fc3-95fd169f6ca1</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/u2u/post.aspx?id=99ba1bfd-9d8e-42f2-9500-cdf8b8c01c50</guid><link>http://blogs.u2u.be/u2u/post/2010/01/20/Service-oriented-architecture-in-SQL-Server-with-Service-Broker.aspx</link><author>Nico Jacobs</author><title>Service oriented architecture in SQL Server with Service Broker</title><description>&lt;p&gt;Wouldn’t it be nice if a stored procedure could run certain statements in parallel, if we could easily scale out SQL Server applications,… When you have code that can run asynchronously, all these things become possible, if you implement them with the Service Broker: Service Broker is an service oriented framework build into SQL Server 2005, and has been extended in SQL Server 2008. If you want to see how to implement code in this framework, and what Service Broker can do for you, come to my talk at the next Belgian SQL user group meeting on February 11. Checkout &lt;a href="http://sqlug.be/blogs/official_sqlugbe_blog/archive/2010/01/14/february-11th-next-ug-evening-on-service-broker.aspx" target="_blank"&gt;www.sqlug.be&lt;/a&gt; for free but required registration.&lt;/p&gt;</description><pubDate>Wed, 20 Jan 2010 12:01:25 -1300</pubDate><comments>http://blogs.u2u.be/u2u/post/2010/01/20/Service-oriented-architecture-in-SQL-Server-with-Service-Broker.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Nico Jacobs</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/u2u/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/u2u/post.aspx?id=99ba1bfd-9d8e-42f2-9500-cdf8b8c01c50</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/u2u/trackback.axd?id=99ba1bfd-9d8e-42f2-9500-cdf8b8c01c50</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/u2u/post/2010/01/20/Service-oriented-architecture-in-SQL-Server-with-Service-Broker.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/u2u/syndication.axd?post=99ba1bfd-9d8e-42f2-9500-cdf8b8c01c50</wfw:commentRss></item><item><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7310338</guid><link>http://weblogs.asp.net/jan/archive/2010/01/14/sharepoint-connections-2010-amp-sharepint-with-belgian-beer-in-amsterdam.aspx</link><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category><title>SharePoint Connections 2010 &amp; SharePINT with Belgian Beer in Amsterdam</title><description>&lt;P mce_keep="true"&gt;Next week (18th and 19th of January, 2010) the &lt;A href="http://www.devconnections.com/speurope/" mce_href="http://www.devconnections.com/speurope/"&gt;Microsoft SharePoint Connections 2010&lt;/A&gt; will be held in Amsterdam RAI (The Netherlands). There is a great lineup of &lt;A href="http://www.devconnections.com/shows/NED2010SP/default.asp?c=2&amp;amp;s=149" mce_href="http://www.devconnections.com/shows/NED2010SP/default.asp?c=2&amp;amp;s=149"&gt;speakers&lt;/A&gt; and &lt;A href="http://www.devconnections.com/shows/NED2010SP/default.asp?c=1&amp;amp;s=149" mce_href="http://www.devconnections.com/shows/NED2010SP/default.asp?c=1&amp;amp;s=149"&gt;sessions&lt;/A&gt; over there, so I'm sure it will be a very interesting event! I will be presenting three sessions, one on Monday and two on Tuesday:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Client-Side Technologies in SharePoint 2010&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Silverlight and SharePoint 2010: Better Together&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Advanced Web Part Development in SharePoint 2010&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;I'm also very proud to mention that &lt;A href="http://www.u2u.be/" mce_href="http://www.u2u.be"&gt;&lt;STRONG&gt;U2U&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt; will be sponsering the SharePINT community event on Monday evening. &lt;/STRONG&gt;As a Belgian company we are of course buying you guys some real Belgian beer (Leffe)! So make sure to visit the expo area of the conference after the last session on Monday and feel free to say hi. :-)&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7310338" width="1" height="1"&gt;</description><pubDate>Thu, 14 Jan 2010 06:44:00 Z</pubDate><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Tielens</dc:creator><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7310338</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2010/01/14/sharepoint-connections-2010-amp-sharepint-with-belgian-beer-in-amsterdam.aspx#comments</comments></item><item><guid isPermaLink="false">http://blogs.u2u.be/kevin/post.aspx?id=1e47854a-7964-47b0-8f3a-6c4364ed45c5</guid><link>http://blogs.u2u.be/kevin/post/2010/01/12/Besug-new-years-drink.aspx</link><author>kevin derudder</author><title>Besug new years drink</title><description>&lt;p&gt;For those who forgot it, tonight Frederik and I invite for our Silverlight user group new years drink. Please check the &lt;a href="http://www.besug.be" target="_blank"&gt;besug&lt;/a&gt; site for more details. &lt;/p&gt;  &lt;p&gt;There will be some silverlight, geek or normal talking with a glass of beer, wine or whatever you like, which is totally for free.&lt;/p&gt;  &lt;p&gt;K.&lt;/p&gt;</description><pubDate>Tue, 12 Jan 2010 00:22:30 -1300</pubDate><comments>http://blogs.u2u.be/kevin/post/2010/01/12/Besug-new-years-drink.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">kevin derudder</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/kevin/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/kevin/post.aspx?id=1e47854a-7964-47b0-8f3a-6c4364ed45c5</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">11</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/kevin/trackback.axd?id=1e47854a-7964-47b0-8f3a-6c4364ed45c5</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/kevin/post/2010/01/12/Besug-new-years-drink.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/kevin/syndication.axd?post=1e47854a-7964-47b0-8f3a-6c4364ed45c5</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/diederik/post.aspx?id=67ebb98f-4594-4a18-bd8d-7bc4ca5113a5</guid><link>http://blogs.u2u.be/diederik/post/2010/01/10/SQL-Spatial-Tools-Map-Projections.aspx</link><author>Diederik Krols</author><category>SQL Server</category><category>WPF</category><title>SQL Spatial Tools: Map Projections</title><description>&lt;p&gt;&lt;a href="http://sqlspatialtools.codeplex.com/"&gt;SQL Server Spatial Tools on CodePlex&lt;/a&gt; contains useful extra functions for the &lt;em&gt;SqlGeometry&lt;/em&gt; and &lt;em&gt;SqlGeography&lt;/em&gt; data types, as well as a new data type for affine transformations (to scale, translate, and rotate) and a handful of &lt;a href="http://en.wikipedia.org/wiki/Map_projection"&gt;Map Projections&lt;/a&gt;. This article describes how to use these projections and visualize the result in Windows Presentation Foundation.&lt;/p&gt;
&lt;p&gt;All projections are instantiated from static method calls against the &lt;em&gt;SqlProjection&lt;/em&gt; class, with one to five parameters. SQL Spatial Tools contains sample T-Sql scripts, but here's how it looks like in C# (for the inverse projection, don't forget to first assign a&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/SRID"&gt;Spatial Reference System Identifier&lt;/a&gt;&amp;nbsp;to the geometry):&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Projection&lt;/strong&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt; shape3D = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;shape3D = &lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt;.Parse(&lt;span style="color: #a31515;"&gt;"some valid WKT"&lt;/span&gt;); &lt;span style="color: green;"&gt;// Or read from DB&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;SqlProjection&lt;/span&gt; proj = &lt;span style="color: #2b91af;"&gt;SqlProjection&lt;/span&gt;.LambertConformalConic(0, 90, 12, 36);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;SqlGeometry&lt;/span&gt; shape2D = proj.Project(shape3D);&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Inverse Projection&lt;/strong&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;SqlGeometry&lt;/span&gt; shape2D = &lt;span style="color: #2b91af;"&gt;SqlGeometry&lt;/span&gt;.Parse(&lt;span style="color: #a31515;"&gt;"some valid WKT"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;shape2D.STSrid = 4326; &lt;span style="color: green;"&gt;// WGS 84&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;SqlProjection&lt;/span&gt; proj = &lt;span style="color: #2b91af;"&gt;SqlProjection&lt;/span&gt;.AlbersEqualArea(0, 0, 15, 30);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;SqlGeography&lt;/span&gt; shape3D = proj.Unproject(shape2D);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;That's all there is to!&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;I added this code to an&amp;nbsp;improved version of my &lt;a href="http://blogs.u2u.be/diederik/post/2010/01/09/Displaying-spatial-data-in-WPF-from-SqlGeometry-to-PathGeometry.aspx"&gt;SqlGeometry Extension Methods for WPF Visualization&lt;/a&gt;. Here's how the resulting application looks like, displaying a reduced shape of Belgium, and the exact location of my office @ U2U Consult:&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fspatialprojection.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;OK, I admit: projecting Belgium is not that spectacular. It will have the same&amp;nbsp;shape in&amp;nbsp;virtually&amp;nbsp;every&amp;nbsp;projection: it's a small surface on&amp;nbsp;an average latitude.&lt;/p&gt;
&lt;p&gt;So let's apply some transformations on a more representative victim such as the &lt;a href="http://en.wikipedia.org/wiki/Tropic_of_Cancer"&gt;Tropic of Cancer&lt;/a&gt;. This will generally be projected as a straight line, but if you stand on the North Pole -e.g. via a &lt;a href="http://en.wikipedia.org/wiki/Gnomonic_projection"&gt;Gnomonic Projection&lt;/a&gt;- it looks like a circle:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2ftropicofcancergnomonic.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;And with a &lt;a href="http://en.wikipedia.org/wiki/Transverse_Mercator_projection"&gt;Transverse Mercator projection&lt;/a&gt; it should look like an Ellipse:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2ftropicofcancertransversemercator.png" alt="" width="50%" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately the SQL Spatial Tools code only implements the Spherical version of the Transverse Mercator projection, and not (yet ?) the Ellipsoidal version. Otherwise SQL Spatial Tools would have all the ingredients for a latitude/longitude &lt;a href="http://en.wikipedia.org/wiki/WGS_84"&gt;WGS84&lt;/a&gt; to &lt;a href="http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system"&gt;UTM&lt;/a&gt; conversion. After all, you only need to project, then scale (to convert to meters), and finally translate (for false easting). This is &lt;a href="http://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.htm"&gt;a horrible calculation&lt;/a&gt;, but don't worry: &lt;a href="http://www.codeplex.com/ProjNET"&gt;Proj.NET on CodePlex&lt;/a&gt; should be able to handle this (this feels like a topic for a later article&lt;img title="Laughing" src="http://blogs.u2u.be/diederik/editors/tiny_mce3/plugins/emotions/img/smiley-laughing.gif" border="0" alt="Laughing" /&gt;).&lt;/p&gt;
&lt;p&gt;Anyway, here's the full solution: &lt;a href="http://blogs.u2u.be/diederik/file.axd?file=2010%2f1%2fU2UConsult.DockOfTheBay.SpatialProjectionsSample.zip"&gt;U2UConsult.DockOfTheBay.SpatialProjectionsSample.zip (144,07 kb)&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Sun, 10 Jan 2010 08:30:00 -1300</pubDate><comments>http://blogs.u2u.be/diederik/post/2010/01/10/SQL-Spatial-Tools-Map-Projections.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Diederik Krols</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/post.aspx?id=67ebb98f-4594-4a18-bd8d-7bc4ca5113a5</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/diederik/trackback.axd?id=67ebb98f-4594-4a18-bd8d-7bc4ca5113a5</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/post/2010/01/10/SQL-Spatial-Tools-Map-Projections.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/syndication.axd?post=67ebb98f-4594-4a18-bd8d-7bc4ca5113a5</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/diederik/post.aspx?id=bd27ea7a-d80f-4318-abbb-c1d4ea14a115</guid><link>http://blogs.u2u.be/diederik/post/2010/01/09/Tuning-SQL-Server-Lookups-to-a-Linked-Server.aspx</link><author>Diederik Krols</author><category>SQL Server</category><title>Tuning SQL Server Lookups to a Linked Server</title><description>&lt;p&gt;In SQL Server, if you join a local table with a table on a linked server (e.g. a remote Oracle instance) you should be prepared for horrible performance. In a lot of scenarios it makes a lot more sense to tell the remote server exactly what you need, store that data in a temporary table, and join locally with it. A couples of weeks ago I used this technique to bring the response time of some queries from SQL Server to a linked Oracle instance down &lt;strong&gt;from 500 seconds to less than one second&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Let's say we want to enumerate the countries that use the Euro as currency, like this (in AdventureWorks2008):&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;c.CurrencyCode, r.Name&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Sales.CountryRegionCurrency&amp;nbsp; c&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;Person.CountryRegion r&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;c.CountryRegionCode = r.CountryRegionCode&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;c.CurrencyCode = &lt;span style="color: #a31515;"&gt;'EUR'&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here's the result:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fsql_lookup_results.png" alt="" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let's suppose that the names of the countries are in a separate database (e.g. an Oracle on an AS/400 box), and there's no replication in place. From SQL Server, we can get access to that source by defining a linked server. For demonstration and practical purposes -I don't have a portable AS/400 with Oracle on it- I'll create a linked server to the local SQL instance:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;execute &lt;/span&gt;sp_addlinkedserver &lt;span style="color: #a31515;"&gt;'.'&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The distributed query will now look like this:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;c.CurrencyCode, r.Name&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Sales.CountryRegionCurrency&amp;nbsp; c&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;[.].AdventureWorks2008.Person.CountryRegion r&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;c.CountryRegionCode = r.CountryRegionCode&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;c.CurrencyCode = &lt;span style="color: #a31515;"&gt;'EUR'&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For this particular query in this particular configuration, the response time is actually still nice (it's already five times slower, but you don't really notice that). In real-life queries -and with a real remote Oracle- you'll notice a dramatic decrease in performance. For this demo configuration, you can use Sql Profiler&amp;nbsp;to reveal the query that&amp;nbsp;was sent to the linked server. Instead of performing a selective look-up, SQL Server selected ALL of the rows, and forced even a SORT on it:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;"Tbl1003"."CountryRegionCode" "Col1011","Tbl1003"."Name" "Col1012"&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;"AdventureWorks2008"."Person"."CountryRegion" "Tbl1003"&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;ORDER BY &lt;/span&gt;"Col1011" &lt;span style="color: blue;"&gt;ASC&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here's a small part of the result for the query:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fsql_lookup_linked.png" alt="" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can imagine what will happen if your lookup target is not a small local table but a large complex view. This is bad for the remote machine, the local machine and the network between the two. All of this happens because SQL Server will try to optimize its own workload, and considers the linked server as a black box (which -in the case of an AS/400- it actually &amp;igrave;s &lt;img title="Wink" src="http://blogs.u2u.be/diederik/editors/tiny_mce3/plugins/emotions/img/smiley-wink.gif" border="0" alt="Wink" /&gt;).&lt;/p&gt;
&lt;p&gt;What we should send to the linked server is a request for a -limited- number of key-value pairs, such as &lt;strong&gt;SELECT id, name FROM blablabla WHERE id in ('id1', 'id2', ...)&lt;/strong&gt;. We should send this query via the &lt;a href="http://msdn.microsoft.com/en-us/library/ms188427.aspx"&gt;OPENQUERY&lt;/a&gt; function, so we can use&amp;nbsp;the native SQL syntax of the remote DMBS. A classic way to create a&amp;nbsp;short comma-separated list in T-SQL is with a variable and the &lt;a href="http://msdn.microsoft.com/en-us/library/ms190349.aspx"&gt;COALESCE&lt;/a&gt; function. If&amp;nbsp;the key is not numeric, then you need to wrap&amp;nbsp;each value&amp;nbsp;in quotes. OPENQUERY uses OLEDB under the hood, and this doesn't like double quotes. So you have to wrap each value in two single quotes that you have to wrap in single quotes during the concatenation. Oops, you're lost ? Just look at the code:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@Countries &lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;(&lt;span style="color: blue;"&gt;MAX&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Create comma-separated list of lookup values&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;;&lt;span style="color: blue;"&gt;WITH &lt;/span&gt;Countries &lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;CountryRegionCode&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Sales.CountryRegionCurrency&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;CurrencyCode = &lt;span style="color: #a31515;"&gt;'EUR'&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;@Countries = &lt;span style="color: blue;"&gt;COALESCE&lt;/span&gt;(@Countries + &lt;span style="color: #a31515;"&gt;','&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;''&lt;/span&gt;) + &lt;span style="color: #a31515;"&gt;'''''' &lt;/span&gt;+ CountryRegionCode + &lt;span style="color: #a31515;"&gt;''''''&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Countries&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;After these calls, the &lt;em&gt;@Countries&lt;/em&gt; variable holds a comma-separated list of country codes:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fsql_lookup_countries.png" alt="" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately &lt;em&gt;OPENQUERY&lt;/em&gt; does'nt take parameters, so we need to construct the whole query dynamically, and call it via &lt;a href="http://msdn.microsoft.com/en-us/library/ms188332.aspx"&gt;EXECUTE&lt;/a&gt;. To store the result, we need to create a temporary table, because unfortunately table variables disappear from the scope with &lt;em&gt;EXECUTE:&lt;/em&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CREATE TABLE &lt;/span&gt;#Countries (CountryRegionCode &lt;span style="color: blue;"&gt;nvarchar&lt;/span&gt;(3), &lt;span style="color: blue;"&gt;Name nvarchar&lt;/span&gt;(50))&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@Query &lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;(&lt;span style="color: blue;"&gt;MAX&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SET &lt;/span&gt;@Query = &lt;span style="color: #a31515;"&gt;'INSERT #Countries ' &lt;/span&gt;+&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'SELECT * FROM OPENQUERY ([.], ' &lt;/span&gt;+&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'''SELECT CountryRegionCode, Name ' &lt;/span&gt;+&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'FROM AdventureWorks2008.Person.CountryRegion ' &lt;/span&gt;+&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'WHERE CountryRegionCode IN (' &lt;/span&gt;+ @Countries + &lt;span style="color: #a31515;"&gt;')'')'&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;EXECUTE &lt;/span&gt;(@Query)&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is the value of the &lt;em&gt;@Query&lt;/em&gt; variable:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fsql_lookup_query.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After these calls, the &lt;em&gt;#Countries&lt;/em&gt; table contains the remote data (at least the fraction we're interested in):&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fsql_lookup_temptable.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So we now can join locally:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;c.CurrencyCode, r.Name&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Sales.CountryRegionCurrency&amp;nbsp; c&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;#Countries r&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;c.CountryRegionCode = r.CountryRegionCode&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;c.CurrencyCode = &lt;span style="color: #a31515;"&gt;'EUR'&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And while the complexity of the code dramatically increased, the response time went down equally dramatically ...&lt;/p&gt;
&lt;p&gt;For the sake of completeness, here's the whole demo script:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/***************/&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/* Preparation */&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/***************/&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/* Add linked server to local instance */&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;execute &lt;/span&gt;sp_addlinkedserver &lt;span style="color: #a31515;"&gt;'.'&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;USE &lt;/span&gt;AdventureWorks2008&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;GO&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/********/&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/* Test */&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/********/&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;span style="color: green;"&gt;-- Local query&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;c.CurrencyCode, r.Name&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Sales.CountryRegionCurrency&amp;nbsp; c&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;Person.CountryRegion r&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;c.CountryRegionCode = r.CountryRegionCode&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;c.CurrencyCode = &lt;span style="color: #a31515;"&gt;'EUR'&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;span style="color: green;"&gt;-- Query through linked server&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;c.CurrencyCode, r.Name&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Sales.CountryRegionCurrency&amp;nbsp; c&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;[.].AdventureWorks2008.Person.CountryRegion r&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;c.CountryRegionCode = r.CountryRegionCode&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;c.CurrencyCode = &lt;span style="color: #a31515;"&gt;'EUR'&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;span style="color: green;"&gt;-- The query sent to the linked server (from Sql Profiler) &lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;"Tbl1003"."CountryRegionCode" "Col1011","Tbl1003"."Name" "Col1012"&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;"AdventureWorks2008"."Person"."CountryRegion" "Tbl1003"&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;ORDER BY &lt;/span&gt;"Col1011" &lt;span style="color: blue;"&gt;ASC&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/**************/&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/* Workaround */&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/**************/&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@Countries &lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;(&lt;span style="color: blue;"&gt;MAX&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Create comma-separated list of lookup values&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;;&lt;span style="color: blue;"&gt;WITH &lt;/span&gt;Countries &lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;CountryRegionCode&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Sales.CountryRegionCurrency&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;CurrencyCode = &lt;span style="color: #a31515;"&gt;'EUR'&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;@Countries = &lt;span style="color: blue;"&gt;COALESCE&lt;/span&gt;(@Countries + &lt;span style="color: #a31515;"&gt;','&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;''&lt;/span&gt;) + &lt;span style="color: #a31515;"&gt;'''''' &lt;/span&gt;+ CountryRegionCode + &lt;span style="color: #a31515;"&gt;''''''&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Countries&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- OLE DB Drivers don't like double quotes, so we have to hexuplicate ;-))&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Uncomment next line for testing&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- SELECT @Countries&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Create temporary table to hold results from query to linked server&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CREATE TABLE &lt;/span&gt;#Countries (CountryRegionCode &lt;span style="color: blue;"&gt;nvarchar&lt;/span&gt;(3), &lt;span style="color: blue;"&gt;Name nvarchar&lt;/span&gt;(50))&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@Query &lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;(&lt;span style="color: blue;"&gt;MAX&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Build query to &lt;/span&gt;&lt;span style="color: green;"&gt;linked server&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SET &lt;/span&gt;@Query = &lt;span style="color: #a31515;"&gt;'INSERT #Countries ' &lt;/span&gt;+&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'SELECT * FROM OPENQUERY ([.], ' &lt;/span&gt;+&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'''SELECT CountryRegionCode, Name ' &lt;/span&gt;+&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'FROM AdventureWorks2008.Person.CountryRegion ' &lt;/span&gt;+&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'WHERE CountryRegionCode IN (' &lt;/span&gt;+ @Countries + &lt;span style="color: #a31515;"&gt;')'')'&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Uncomment next line for testing&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- SELECT @Query&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Execute query to linked server&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;EXECUTE &lt;/span&gt;(@Query)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Uncomment next line for testing&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- SELECT * FROM #Countries&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Execute query entirely locally&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;c.CurrencyCode, r.Name&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;Sales.CountryRegionCurrency&amp;nbsp; c&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;#Countries r&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;c.CountryRegionCode = r.CountryRegionCode&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;c.CurrencyCode = &lt;span style="color: #a31515;"&gt;'EUR'&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DROP TABLE &lt;/span&gt;#Countries&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/************/&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/* Teardown */&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/************/&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/* Remove linked server */&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;execute &lt;/span&gt;sp_dropserver &lt;span style="color: #a31515;"&gt;'.'&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;</description><pubDate>Sat, 09 Jan 2010 04:04:00 -1300</pubDate><comments>http://blogs.u2u.be/diederik/post/2010/01/09/Tuning-SQL-Server-Lookups-to-a-Linked-Server.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Diederik Krols</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/post.aspx?id=bd27ea7a-d80f-4318-abbb-c1d4ea14a115</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/diederik/trackback.axd?id=bd27ea7a-d80f-4318-abbb-c1d4ea14a115</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/post/2010/01/09/Tuning-SQL-Server-Lookups-to-a-Linked-Server.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/syndication.axd?post=bd27ea7a-d80f-4318-abbb-c1d4ea14a115</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/diederik/post.aspx?id=f37453f6-f3ae-426d-bfff-2fb135db94d0</guid><link>http://blogs.u2u.be/diederik/post/2010/01/05/Displaying-spatial-data-in-WPF-from-SqlGeometry-to-PathGeometry.aspx</link><author>Diederik Krols</author><category>WPF</category><category>SQL Server</category><title>Displaying spatial data in WPF: from SqlGeometry to PathGeometry</title><description>&lt;p&gt;This article explains how to visualize spatial data (e.g. from SQL Server 2008) in Windows Presentation Foundation without using 3rd party components or proprietary formats. We'll build a little form that allows us to enter test data in the &lt;a href="http://en.wikipedia.org/wiki/Well-known_text"&gt;Well-Known Text format&lt;/a&gt; (WKT) - manually or via copy/paste, e.g. from SQL Management Studio.&amp;nbsp;A &lt;em&gt;Draw&lt;/em&gt; button will convert our input to WPF graphics, and display it. Here's how the application looks like:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fSpatial.png" alt="" width="50%" /&gt;&lt;/p&gt;
&lt;p&gt;It's probably a waste of time to do the validation of the input text and&amp;nbsp;the&amp;nbsp;parsing of&amp;nbsp;its&amp;nbsp;structure&amp;nbsp;ourselves, since the native spatial SQL Server .NET UDTs -&lt;em&gt;SqlGeometry&lt;/em&gt; and &lt;em&gt;SqlGeography&lt;/em&gt;- are specialized in that. These&amp;nbsp;types&amp;nbsp;are stored in the &lt;em&gt;Microsoft.SqlServer.Types&lt;/em&gt; assembly, so we should make a reference to that one&amp;nbsp;in our project. On the user interface side, the best candidate type to visualize spatial data in WPF is without any doubt the &lt;a href="http://msdn.microsoft.com/en-us/library/ms751808.aspx"&gt;Geometry&lt;/a&gt; class, which&amp;nbsp;represents a composite 2D-shape. To create a WPF version of spatial data, we read the WKT format&amp;nbsp;and use it to initialize a &lt;em&gt;SqlGeometry&lt;/em&gt; instance. Then&amp;nbsp;we call some of the OGC-functions to break&amp;nbsp;the &lt;a href="http://msdn.microsoft.com/en-us/library/bb964711.aspx"&gt;SqlGeometry Object Model&lt;/a&gt; down into a &lt;a href="http://msdn.microsoft.com/en-us/library/ms745814.aspx"&gt;PathGeometry Structure&lt;/a&gt;. For ease of use, it makes sense to&amp;nbsp;wrap this functionality in extension methods for &lt;em&gt;SqlGeometry&lt;/em&gt;. Here's the class:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; U2UConsult.DockOfTheBay&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows.Media;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows.Shapes;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; Microsoft.SqlServer.Types;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Extension Methods for SqlGeometry.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlGeometryExtensions&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Translates a SqlGeometry into a Systems.Windows.Media.Geometry.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Geometry&lt;/span&gt; AsWpfGeometry(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlGeometry&lt;/span&gt; sqlGeometry)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;PathGeometry&lt;/span&gt; result = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;PathGeometry&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;switch&lt;/span&gt; (sqlGeometry.STGeometryType().Value.ToLower())&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"point"&lt;/span&gt;:&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Return a little 'X' &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// (well: 'little' depends on the coordinate system ...)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;PathFigure&lt;/span&gt; pointFigure = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;PathFigure&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&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; pointFigure.StartPoint = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Point&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry.STX.Value - .1,&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry.STY.Value - .1);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;LineSegment&lt;/span&gt; line = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;LineSegment&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Point&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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;nbsp;&amp;nbsp; sqlGeometry.STX.Value + .1,&lt;/p&gt;
&lt;p style="margin: 0px;"&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;nbsp;&amp;nbsp; sqlGeometry.STY.Value + .1),&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&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; pointFigure.Segments.Add(line);&lt;/p&gt;
&lt;p style="margin: 0px;"&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; result.Figures.Add(pointFigure);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; pointFigure = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;PathFigure&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&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; pointFigure.StartPoint = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Point&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry.STX.Value - .1,&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry.STY.Value + .1);&lt;/p&gt;
&lt;p style="margin: 0px;"&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; line = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;LineSegment&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Point&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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;nbsp;&amp;nbsp; sqlGeometry.STX.Value + .1,&lt;/p&gt;
&lt;p style="margin: 0px;"&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;nbsp;&amp;nbsp; sqlGeometry.STY.Value - .1),&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&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; pointFigure.Segments.Add(line);&lt;/p&gt;
&lt;p style="margin: 0px;"&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; result.Figures.Add(pointFigure);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; result;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"polygon"&lt;/span&gt;:&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// A Spacial Polygon is a collection of Rings&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// A Ring is a Closed LineString&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// So, return a PathFigure for each Ring&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Outer Ring&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; result.Figures.Add(LineStringToWpfGeometry(sqlGeometry.STExteriorRing()));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Inner Rings&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 1; i &amp;lt;= sqlGeometry.STNumInteriorRing(); i++)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&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; result.Figures.Add(LineStringToWpfGeometry(sqlGeometry.STInteriorRingN(i)));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; result;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"linestring"&lt;/span&gt;:&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Return a PathFigure&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; result.Figures.Add(LineStringToWpfGeometry(sqlGeometry));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; result;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"multipoint"&lt;/span&gt;:&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"multilinestring"&lt;/span&gt;:&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"multipolygon"&lt;/span&gt;:&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"geometrycollection"&lt;/span&gt;:&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Return a Group of Geometries&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;GeometryGroup&lt;/span&gt; geometryGroup = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;GeometryGroup&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 1; i &amp;lt;= sqlGeometry.STNumGeometries().Value; i++)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&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; geometryGroup.Children.Add(sqlGeometry.STGeometryN(i).AsWpfGeometry());&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; geometryGroup;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;default&lt;/span&gt;:&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Unrecognized Type&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Return an empty Geometry&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Geometry&lt;/span&gt;.Empty;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Translates a SqlGeometry into a Systems.Windows.Shapes.Path.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt; AsPath(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlGeometry&lt;/span&gt; sqlGeometry)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt; path = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; path.Data = sqlGeometry.AsWpfGeometry();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; path;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Translates a LineString or a single Polygon Ring to a PathFigure.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;PathFigure&lt;/span&gt; LineStringToWpfGeometry(&lt;span style="color: #2b91af;"&gt;SqlGeometry&lt;/span&gt; sqlGeometry)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;PathFigure&lt;/span&gt; result = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;PathFigure&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; result.StartPoint = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Point&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry.STPointN(1).STX.Value,&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry.STPointN(1).STY.Value);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 1; i &amp;lt;= sqlGeometry.STNumPoints(); i++)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: #2b91af;"&gt;LineSegment&lt;/span&gt; lineSegment = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;LineSegment&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&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; lineSegment.Point = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Point&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry.STPointN(i).STX.Value,&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry.STPointN(i).STY.Value);&lt;/p&gt;
&lt;p style="margin: 0px;"&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; result.Segments.Add(lineSegment);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; result;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;To use these extension methods, all we&amp;nbsp;need to do is create a &lt;em&gt;SqlGeometry&lt;/em&gt; instance with some data. Then we need to ensure it's valid against the OGC&amp;nbsp;standards,&amp;nbsp;so that the &lt;a href="http://msdn.microsoft.com/en-us/library/bb933960.aspx"&gt;OGC compliant sql methods&lt;/a&gt; behave properly. Finally we call the conversion, like this:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Make OGC Compliant&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (!sqlGeometry.STIsValid())&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlGeometry = sqlGeometry.MakeValid();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Transformation Samples&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt; path = sqlGeometry.AsPath();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;Geometry&lt;/span&gt; geometry = sqlGeometry.AsWpfGeometry();&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;We end up with a &lt;em&gt;Geometry&lt;/em&gt; that is expressed in the&amp;nbsp;original spatial coordinates: latitude/longitude or X/Y against a specific &lt;a href="http://en.wikipedia.org/wiki/SRID"&gt;SRID&lt;/a&gt;. So&amp;nbsp;we need to translate and scale&amp;nbsp;it, to project it to windows coordinates. Since we only visualize one shape, it suffices to let it stretch automatically in its container. By the way: don't forget to draw upside-down, because the origin of a Control is the upper left corner while the origin of a map is generally at the bottom left:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Flip Y-coordinate&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Origin of a map is usually at the bottom left&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;path.LayoutTransform = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ScaleTransform&lt;/span&gt;(1, -1);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Automate Translation &amp;amp; Inflation&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;path.Stretch = &lt;span style="color: #2b91af;"&gt;Stretch&lt;/span&gt;.Uniform;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Samples&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I tested the code against a high number of possible (mostly Belgian) shapes. Here are some examples:&lt;/p&gt;
&lt;table style="width: 50%;" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;The &lt;a href="http://en.wikipedia.org/wiki/Zenne"&gt;river Zenne&lt;/a&gt; at the point where it leaves Brussels, heading to the north. An example of a LineString.&lt;/td&gt;
&lt;td&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fZenne_exit_Brussels.png" alt="" width="50%" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;The &lt;a href="http://en.wikipedia.org/wiki/Antwerp_(province)"&gt;province of Antwerp&lt;/a&gt;. An example of a MultiPolygon.&lt;/td&gt;
&lt;td&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fProvince_Antwerp.png" alt="" width="50%" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;The &lt;a href="http://en.wikipedia.org/wiki/Flemish_Brabant"&gt;province of Flemish Brabant&lt;/a&gt;. An example of a Polygon with an inner Ring.&lt;/td&gt;
&lt;td&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fProvince_Flemish_Brabant.png" alt="" width="50%" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;The &lt;a href="http://en.wikipedia.org/wiki/Brussels-Halle-Vilvoorde"&gt;arrondissement Halle-Vilvoorde&lt;/a&gt;. An example of a Polygon.&lt;/td&gt;
&lt;td&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2010%2f1%2fHalle_Vilvoorde.png" alt="" width="50%" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here's the full code for the WPF Window. To bring you up-to-speed immediately, it starts with a reduced shape (24 Points) of Belgium:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;XAML:&lt;/strong&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Window&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Class&lt;/span&gt;&lt;span style="color: blue;"&gt;="U2UConsult.DockOfTheBay.SpatialSample"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="SQL Spatial to WPF Sample"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Icon&lt;/span&gt;&lt;span style="color: blue;"&gt;="/U2UConsult.DockOfTheBay;component/dotbay.png"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RowDefinition&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="*" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="*" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="2*" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Button&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="DrawButton"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Click&lt;/span&gt;&lt;span style="color: blue;"&gt;="DrawButton_Click"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Draw"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue;"&gt;="0"&lt;/span&gt;&lt;span style="color: red;"&gt; Grid.Column&lt;/span&gt;&lt;span style="color: blue;"&gt;="1"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;="15"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="32"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="64"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Left"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Bottom"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;&amp;lt;!-- Reduced shape of Belgium --&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;TextBox&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="GeometryTextBox"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;="5"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue;"&gt;="0"&lt;/span&gt;&lt;span style="color: red;"&gt; Grid.Column&lt;/span&gt;&lt;span style="color: blue;"&gt;="0"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;TextWrapping&lt;/span&gt;&lt;span style="color: blue;"&gt;="Wrap"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;AcceptsReturn&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;AcceptsTab&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;="POLYGON ((&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 5.4695768356323242 49.499450206756592, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 5.8744573593139648 49.576767921447754, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 5.7810144424438477 49.959678173065186, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 6.4083404541015625 50.333068847656250, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 6.1721935272216800 50.550515174865723, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 6.2783794403076172 50.616397857666016, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 5.6911020278930664 50.761138916015625, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 5.8341245651245117 51.168460845947266, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 5.2405147552490234 51.261853218078613, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 5.0372371673583984 51.485389232635500, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 4.4786109924316406 51.480998992919922, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 3.9020967483520508 51.198946952819824, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 3.1825008392333984 51.361250877380371, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 2.5581483840942383 51.093193054199219, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 2.6278944015502930 50.814075946807861, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 3.1747541427612305 50.752677917480469, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 3.2816371917724609 50.526985168457031, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 3.6048288345336914 50.489061832427979, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 3.7020025253295900 50.300303936004639, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 4.2115697860717773 50.269905090332031, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 4.1991643905639648 49.960120201110840, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 4.6723327636718750 49.985515117645264, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 4.8746204376220700 50.151000022888184, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 4.8553209304809570 49.794033050537109, &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&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; 5.4695768356323242 49.499450206756592))"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;ToolTip&lt;/span&gt;&lt;span style="color: blue;"&gt;="Place your Well-Known Text here ..."&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Border&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="DrawingCanvas"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Padding&lt;/span&gt;&lt;span style="color: blue;"&gt;="15"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue;"&gt;="0"&lt;/span&gt;&lt;span style="color: red;"&gt; Grid.Column&lt;/span&gt;&lt;span style="color: blue;"&gt;="1"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Window&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;C#:&lt;/strong&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; U2UConsult.DockOfTheBay&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows.Controls;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows.Media;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows.Shapes;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; Microsoft.SqlServer.Types; &lt;span style="color: green;"&gt;// Add Reference !!!&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Demonstrates displaying SQL Server Spatial data in WPF. &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SpatialSample&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;Window&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; SpatialSample()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; DrawButton_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Read Well-Known Text&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: #2b91af;"&gt;SqlGeometry&lt;/span&gt; sqlGeometry = &lt;span style="color: #2b91af;"&gt;SqlGeometry&lt;/span&gt;.Parse(&lt;span style="color: blue;"&gt;this&lt;/span&gt;.GeometryTextBox.Text);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Make OGC Compliant&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!sqlGeometry.STIsValid())&lt;/p&gt;
&lt;p style="margin: 0px;"&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; {&lt;/p&gt;
&lt;p style="margin: 0px;"&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; sqlGeometry = sqlGeometry.MakeValid();&lt;/p&gt;
&lt;p style="margin: 0px;"&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; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Transform to Path&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt; path = sqlGeometry.AsPath();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Basic Properties&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; path.Stroke = &lt;span style="color: #2b91af;"&gt;Brushes&lt;/span&gt;.Black;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; path.StrokeThickness = 1;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Polygons only ...&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;//path.Effect = new DropShadowEffect() { Direction = 225 };&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;//path.Fill = Brushes.DarkGreen;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Flip Y-coordinate&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Origin of a map is usually at the bottom left&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; path.LayoutTransform = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ScaleTransform&lt;/span&gt;(1, -1);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Automate Translation &amp;amp; Inflation&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; path.Stretch = &lt;span style="color: #2b91af;"&gt;Stretch&lt;/span&gt;.Uniform;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;this&lt;/span&gt;.DrawingCanvas.Child = path;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: green;"&gt;// Input not valid&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&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; &lt;span style="color: blue;"&gt;this&lt;/span&gt;.DrawingCanvas.Child = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;TextBlock&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px;"&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; {&lt;/p&gt;
&lt;p style="margin: 0px;"&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; TextWrapping = &lt;span style="color: #2b91af;"&gt;TextWrapping&lt;/span&gt;.Wrap,&lt;/p&gt;
&lt;p style="margin: 0px;"&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; MaxHeight = 128,&lt;/p&gt;
&lt;p style="margin: 0px;"&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; VerticalAlignment = &lt;span style="color: #2b91af;"&gt;VerticalAlignment&lt;/span&gt;.Top,&lt;/p&gt;
&lt;p style="margin: 0px;"&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; Foreground = &lt;span style="color: #2b91af;"&gt;Brushes&lt;/span&gt;.Red,&lt;/p&gt;
&lt;p style="margin: 0px;"&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; Text = ex.Message&lt;/p&gt;
&lt;p style="margin: 0px;"&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; };&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;</description><pubDate>Tue, 05 Jan 2010 14:17:00 -1300</pubDate><comments>http://blogs.u2u.be/diederik/post/2010/01/05/Displaying-spatial-data-in-WPF-from-SqlGeometry-to-PathGeometry.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Diederik Krols</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/diederik/post.aspx?id=f37453f6-f3ae-426d-bfff-2fb135db94d0</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/diederik/trackback.axd?id=f37453f6-f3ae-426d-bfff-2fb135db94d0</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/post/2010/01/05/Displaying-spatial-data-in-WPF-from-SqlGeometry-to-PathGeometry.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/diederik/syndication.axd?post=f37453f6-f3ae-426d-bfff-2fb135db94d0</wfw:commentRss></item><item><guid isPermaLink="false">http://blogs.u2u.be/kris/post.aspx?id=c714354c-a0dc-460b-b8e7-646f6c28ad1d</guid><link>http://blogs.u2u.be/kris/post/2009/12/29/Static-Reflection-in-NET-part-2.aspx</link><author>Kris Vandermotten</author><category>.NET</category><title>Static Reflection in .NET, part 2</title><description>&lt;p&gt;A few weeks ago, I talked about &lt;a href="http://blogs.u2u.net/kris/post/2009/10/17/Static-Reflection-in-NET.aspx" target="_blank"&gt;static reflection&lt;/a&gt; and its advantages. You’ll remember that the main advantages, compared to the normal reflection API’s, are the compile time checking of parameters and IntelliSense support.&lt;/p&gt;  &lt;p&gt;How does it compare at other levels, performance for example? Before we dive into that question, let me state that performance may or may not be important to you. A program that is fast enough is, well, fast enough. It’s unlikely that a (single) reflection call will have a significant impact on, say, the response time of a graphical user interface, and so performance doesn’t matter. If you’re algorithm requires millions of reflection operations, I’m sure you can rewrite it somehow to reduce that number significantly, and then performance again probably doesn’t matter anymore. That being said, we still want to know, right?&lt;/p&gt;  &lt;p&gt;First of all, let’s compare code.&lt;/p&gt;  &lt;p&gt;Take this line (using the Example class from the last post):&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;PropertyInfo &lt;/span&gt;pi = &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Example&lt;/span&gt;).GetProperty(&lt;span style="color: #a31515"&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

&lt;br /&gt;

&lt;p&gt;This line compiles to the following IL (simplified for readability):&lt;/p&gt;

&lt;pre class="code"&gt;ldtoken Example 
call class Type Type::GetTypeFromHandle(valuetype RuntimeTypeHandle) 
ldstr &amp;quot;Description&amp;quot; 
call instance class PropertyInfo Type::GetProperty(string)&lt;/pre&gt;

&lt;br /&gt;

&lt;p&gt;Compare that to the following line:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;PropertyInfo &lt;/span&gt;pi = &lt;span style="color: #2b91af"&gt;StaticReflector&lt;/span&gt;.Create&amp;lt;&lt;span style="color: #2b91af"&gt;Example&lt;/span&gt;&amp;gt;().PropertyInfo(e =&amp;gt; e.Description);&lt;/pre&gt;

&lt;br /&gt;

&lt;p&gt;Which compiles to:&lt;/p&gt;

&lt;pre class="code"&gt;call class IStaticReflector`1&amp;lt;!!0&amp;gt; StaticReflector::Create&amp;lt;class Example&amp;gt;()
ldtoken Example
call class Type Type::GetTypeFromHandle(valuetype RuntimeTypeHandle)
ldstr &amp;quot;e&amp;quot;
call class ParameterExpression Expression::Parameter(class Type, string)
stloc.0 
ldloc.0 
ldtoken instance string Example::get_Description()
call class MethodBase MethodBase::GetMethodFromHandle(valuetype RuntimeMethodHandle)
castclass MethodInfo
call class MemberExpression Expression::Property(class Expression, class MethodInfo)
ldc.i4.1 
newarr ParameterExpression
stloc.1 
ldloc.1 
ldc.i4.0 
ldloc.0 
stelem.ref 
ldloc.1 
call class Expression`1&amp;lt;!!0&amp;gt; Expression::Lambda&amp;lt;class System.Func`2&amp;lt;class Example, string&amp;gt;&amp;gt;(class Expression, class ParameterExpression[])
call class PropertyInfo StaticReflectorExtensions::PropertyInfo&amp;lt;class Example, string&amp;gt;(class IStaticReflector`1&amp;lt;!!0&amp;gt;, class Expression`1&amp;lt;class System.Func`2&amp;lt;!!0, !!1&amp;gt;&amp;gt;)&lt;/pre&gt;

&lt;br /&gt;

&lt;p&gt;As you can see, this code doesn’t load the “Description” string, it uses the ldtoken instruction instead. Some bloggers have suggested that this would make it more efficient. Unfortunately, even if the ldtoken instruction is efficient, it is largely offset by the construction of the lambda expression. I ran a little benchmark, in which I compare execution time (in ticks) and memory usage (in generation 0 garbage collection runs) of both approaches, executing each one a million times. This is the result (on my laptop):&lt;/p&gt;

&lt;pre class="code"&gt;Using Reflection       Time:    1089308 Collections:    45
Using StaticReflection Time:   13513777 Collections:   264&lt;/pre&gt;

&lt;br /&gt;

&lt;p&gt;As you can see, the Static Reflection approach is about 13.5 times slower than the good old dynamic reflection, and it uses a lot more memory. That should be no surprise either: both cases allocate a PropertyInfo object, but the static case also allocates the expression, which is nothing but food for the garbage collector.&lt;/p&gt;

&lt;p&gt;So, one approach seems good at compile time, and the other is good at run time. It seems we’re stuck between a rock and a hard place. But the situation isn’t so bad: we have two options to choose from, each with their pro’s and con’s. What the best one is depends on your requirements, and what you value the most: compile time checking (which may result in productivity and maintainability benefits), or performance.&lt;/p&gt;

&lt;p&gt;And who knows, maybe there is a third option, giving the best of both worlds. But that’s for next time.&lt;/p&gt;</description><pubDate>Tue, 29 Dec 2009 20:23:53 -1300</pubDate><comments>http://blogs.u2u.be/kris/post/2009/12/29/Static-Reflection-in-NET-part-2.aspx#comment</comments><dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Kris Vandermotten</dc:publisher><pingback:server xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/kris/pingback.axd</pingback:server><pingback:target xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/">http://blogs.u2u.be/kris/post.aspx?id=c714354c-a0dc-460b-b8e7-646f6c28ad1d</pingback:target><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">31</slash:comments><trackback:ping xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">http://blogs.u2u.be/kris/trackback.axd?id=c714354c-a0dc-460b-b8e7-646f6c28ad1d</trackback:ping><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/kris/post/2009/12/29/Static-Reflection-in-NET-part-2.aspx#comment</wfw:comment><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.u2u.be/kris/syndication.axd?post=c714354c-a0dc-460b-b8e7-646f6c28ad1d</wfw:commentRss></item><item><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7288512</guid><link>http://weblogs.asp.net/jan/archive/2009/12/22/may-i-introduce-you-to-lis-tielens.aspx</link><title>May I introduce you to Lis Tielens</title><description>&lt;P mce_keep="true"&gt;I'm very happy to announce that this morning our daugher Lis was born. She and her mother are recovering from the C-section but they are doing well. For more news (in Dutch), feel free to check out&amp;nbsp;our family blog: &lt;A href="http://kids.neleenjan.net/"&gt;http://kids.neleenjan.net&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 500px; HEIGHT: 410px" src="http://farm5.static.flickr.com/4028/4206072145_438008cc3b.jpg" width=500 height=410 mce_src="http://farm5.static.flickr.com/4028/4206072145_438008cc3b.jpg"&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7288512" width="1" height="1"&gt;</description><pubDate>Tue, 22 Dec 2009 21:33:00 Z</pubDate><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Tielens</dc:creator><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">25</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7288512</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/12/22/may-i-introduce-you-to-lis-tielens.aspx#comments</comments></item><item><guid isPermaLink="false">http://blogs.u2u.be/diederik/post.aspx?id=77a3d451-f08a-4836-850d-72e4d7afad25</guid><link>http://blogs.u2u.be/diederik/post/2009/12/18/A-WPF-Ribbon-Control-Walkthrough.aspx</link><author>Diederik Krols</author><category>WPF</category><title>An Office WPF Ribbon Control Walkthrough</title><description>&lt;p&gt;The Microsoft WPF Ribbon control is a free control that brings the Office 2007 Ribbon features to your WPF applications. To get your hands on it, just follow the instructions on &lt;a href="http://www.codeplex.com/wikipage?ProjectName=wpf&amp;amp;title=WPF%20Ribbon%20Preview"&gt;CodePlex&lt;/a&gt;. This article walks through the Ribbon features. I simply built "NotePad with a Ribbon". Here's how it looks like:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2009%2f12%2fRibbonNotepad.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;The container is of the type &lt;em&gt;RibbonWindow&lt;/em&gt;, a subclass of Window that overrides some of the native GDI-code to let the &lt;em&gt;ApplicationButton&lt;/em&gt; and the &lt;em&gt;QuickAccessToolBar&lt;/em&gt; appear in the form's title bar. The only controls on it are a Ribbon control and a TextBox (after all, Notepad &amp;igrave;s just a textbox with a menu). I wrapped them in a DockPanel:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonWindow&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Class&lt;/span&gt;&lt;span style="color: blue;"&gt;="RibbonSample.RibbonSampleWindow"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="WPF Office Ribbon Sample"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;DockPanel&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Ribbon&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="color: blue;"&gt;="Top"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Binding&lt;/span&gt;&lt;span style="color: red;"&gt; RelativeSource&lt;/span&gt;&lt;span style="color: blue;"&gt;={&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RelativeSource&lt;/span&gt;&lt;span style="color: red;"&gt; FindAncestor&lt;/span&gt;&lt;span style="color: blue;"&gt;,&lt;/span&gt;&lt;span style="color: red;"&gt;AncestorType&lt;/span&gt;&lt;span style="color: blue;"&gt;={&lt;/span&gt;&lt;span style="color: #a31515;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Type&lt;/span&gt;&lt;span style="color: red;"&gt; Window&lt;/span&gt;&lt;span style="color: blue;"&gt;}},&lt;/span&gt;&lt;span style="color: red;"&gt;Path&lt;/span&gt;&lt;span style="color: blue;"&gt;=Title}"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Ribbon&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;TextBox&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="NotePadTextBox"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="color: blue;"&gt;="Top"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;AcceptsReturn&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;AcceptsTab&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;TextWrapping&lt;/span&gt;&lt;span style="color: blue;"&gt;="Wrap" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;DockPanel&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonWindow&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The meat of the Ribbon is a series of &lt;em&gt;RibbonTabs&lt;/em&gt; with a Label and an array of &lt;em&gt;RibbonGroup&lt;/em&gt; elements that contain the RibbonControls (&lt;em&gt;RibbonButton&lt;/em&gt;, &lt;em&gt;RibbonComboBox&lt;/em&gt;), individually or grouped into a &lt;em&gt;RibbonControlGroup&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2009%2f12%2fRibbonMainControls.png" alt="" /&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Ribbon&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="color: blue;"&gt;="Top"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Binding&lt;/span&gt;&lt;span style="color: red;"&gt; RelativeSource&lt;/span&gt;&lt;span style="color: blue;"&gt;={&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RelativeSource&lt;/span&gt;&lt;span style="color: red;"&gt; FindAncestor&lt;/span&gt;&lt;span style="color: blue;"&gt;,&lt;/span&gt;&lt;span style="color: red;"&gt;AncestorType&lt;/span&gt;&lt;span style="color: blue;"&gt;={&lt;/span&gt;&lt;span style="color: #a31515;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Type&lt;/span&gt;&lt;span style="color: red;"&gt; Window&lt;/span&gt;&lt;span style="color: blue;"&gt;}},&lt;/span&gt;&lt;span style="color: red;"&gt;Path&lt;/span&gt;&lt;span style="color: blue;"&gt;=Title}"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonTab&lt;/span&gt;&lt;span style="color: red;"&gt; Label&lt;/span&gt;&lt;span style="color: blue;"&gt;="Home"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonTab.Groups&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;&amp;lt;!-- Clipboard Commands --&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonCommand&lt;/span&gt;&lt;span style="color: red;"&gt; LabelTitle&lt;/span&gt;&lt;span style="color: blue;"&gt;="Clipboard" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Paste" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Copy" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Cut" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;&amp;lt;!-- Font Commands --&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonCommand&lt;/span&gt;&lt;span style="color: red;"&gt; LabelTitle&lt;/span&gt;&lt;span style="color: blue;"&gt;="Font" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonControlGroup&lt;/span&gt;&lt;span style="color: red;"&gt; Tag&lt;/span&gt;&lt;span style="color: blue;"&gt;="FontFamily" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonControlGroup&lt;/span&gt;&lt;span style="color: red;"&gt; Tag&lt;/span&gt;&lt;span style="color: blue;"&gt;="FontColor" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;&amp;lt;!-- Zoom Commands --&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonCommand&lt;/span&gt;&lt;span style="color: red;"&gt; LabelTitle&lt;/span&gt;&lt;span style="color: blue;"&gt;="Zoom" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Zoom In" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&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; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Zoom Out" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonTab.Groups&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonTab&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonTab&lt;/span&gt;&lt;span style="color: red;"&gt; Label&lt;/span&gt;&lt;span style="color: blue;"&gt;="View" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Ribbon&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;RibbonGroup&lt;/em&gt; has a collection of &lt;em&gt;GroupSizeDefinitions&lt;/em&gt; that control layout and resizing. This is the configuration of my Clipboard-group, with one large and two small icons. You can put multiple alternatives here; when you resize the form, the Ribbon will layout properly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2009%2f12%2fGroupSizeDefinition.PNG" alt="" /&gt;&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.GroupSizeDefinitions&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroupSizeDefinitionCollection&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroupSizeDefinition&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonControlSizeDefinition&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;ImageSize&lt;/span&gt;&lt;span style="color: blue;"&gt;="Large"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;IsLabelVisible&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonControlSizeDefinition&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;ImageSize&lt;/span&gt;&lt;span style="color: blue;"&gt;="Small"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;IsLabelVisible&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonControlSizeDefinition&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;ImageSize&lt;/span&gt;&lt;span style="color: blue;"&gt;="Small"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;IsLabelVisible&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroupSizeDefinition&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroupSizeDefinitionCollection&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.GroupSizeDefinitions&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;All RibbonControls can have a &lt;em&gt;Command&lt;/em&gt; property, and instance of &lt;em&gt;RibbonCommand&lt;/em&gt;. This is actually a subclass of &lt;em&gt;RoutedCommand&lt;/em&gt;, implementing extra GUI-focused properties: labels, tooltips, and large and small image sources.&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Paste"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonCommand&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;CanExecute&lt;/span&gt;&lt;span style="color: blue;"&gt;="PasteCommand_CanExecute"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;Executed&lt;/span&gt;&lt;span style="color: blue;"&gt;="PasteCommand_Executed"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;LabelTitle&lt;/span&gt;&lt;span style="color: blue;"&gt;="Paste"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;ToolTipTitle&lt;/span&gt;&lt;span style="color: blue;"&gt;="Paste"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;ToolTipDescription&lt;/span&gt;&lt;span style="color: blue;"&gt;="Paste text element from the clipboard."&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;SmallImageSource&lt;/span&gt;&lt;span style="color: blue;"&gt;="Assets/Images/Paste.png"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;LargeImageSource&lt;/span&gt;&lt;span style="color: blue;"&gt;="Assets/Images/Paste.png" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonButton&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Controls can be (re-)grouped into a &lt;em&gt;RibbonControlGroup&lt;/em&gt; e.g. to form a Gallery. I used two such groups for the font commands:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 9pt; color: black; background: white;"&gt;
&lt;p&gt;&lt;img src="http://blogs.u2u.be/diederik/image.axd?picture=2009%2f12%2fRibbonControlGroups.PNG" alt="" /&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;&amp;lt;!-- Font Commands --&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonCommand&lt;/span&gt;&lt;span style="color: red;"&gt; LabelTitle&lt;/span&gt;&lt;span style="color: blue;"&gt;="Font" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonGroup.Command&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonControlGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonLabel&lt;/span&gt;&lt;span style="color: red;"&gt; Tag&lt;/span&gt;&lt;span style="color: blue;"&gt;="Font Image" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonComboBox&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonComboBoxItem&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Tahoma"/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonComboBoxItem&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Comic Sans MS"/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonComboBoxItem&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Wingdings"/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonComboBox&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RibbonControlGroup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;r&lt;