<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Brenton House</title><subtitle type="html">what are you looking at?</subtitle><id>http://weblogs.asp.net/bhouse/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/bhouse/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2006-08-29T07:48:30Z</updated><entry><title>Extension Methods with Enum Description</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2008/07/10/extension-methods-with-enum-description.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2008/07/10/extension-methods-with-enum-description.aspx</id><published>2008-07-10T17:26:02Z</published><updated>2008-07-10T17:26:02Z</updated><content type="html">&lt;p&gt;Since Enum names in .NET do not support certain characters like spaces, often developers will use the &lt;a href="http://msdn.microsoft.akadns.net/en-us/library/system.componentmodel.descriptionattribute.aspx" target="_blank"&gt;DescriptionAttribute&lt;/a&gt; to add detailed text to an Enum.&amp;#160; &lt;/p&gt;  &lt;div id="CodeTitleBar" style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; word-spacing: normal; padding-top: 3px; border-bottom: black 1px dashed; white-space: nowrap; letter-spacing: normal; height: 25px; background-color: #eeeeee"&gt;   &lt;div style="float: right; text-align: right"&gt;&lt;a onmouseover="window.status=&amp;#39;Copy this code&amp;#39;;return true;" style="text-decoration: none" onmouseout="window.status=&amp;#39;&amp;#39;;return true;" href="javascript:window.clipboardData.setData('Text', document.getElementById('a677798e-4ec5-46af-b0a6-011824dfe273').innerText);void(0)"&gt;&lt;img src="http://static.flickr.com/88/267822310_ee69af9633_m.jpg" align="middle" border="0" /&gt;&amp;#160;&amp;#160; &lt;font face="Arial"&gt;&lt;/font&gt;&lt;font size="1"&gt;Copy Code&lt;/font&gt; &lt;/a&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div id="a677798e-4ec5-46af-b0a6-011824dfe273" style="padding-right: 5px; padding-left: 5px; overflow-x: scroll; padding-bottom: 5px; padding-top: 5px"&gt;   &lt;div style="font-size: 10pt; color: black; font-family: courier new"&gt;     &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160; [&lt;span style="color: #2b91af"&gt;Flags&lt;/span&gt;]&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;internal&lt;/span&gt; &lt;span style="color: blue"&gt;enum&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SuperHero&lt;/span&gt; &lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160; {&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #2b91af"&gt;Description&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Clark Kent&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Superman = 1,&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #2b91af"&gt;Description&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Peter Parker&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SpiderMan = 2,&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #2b91af"&gt;Description&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Bruce Banner&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Hulk = 4,&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #2b91af"&gt;Description&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Tony Stark&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IronMan = 8,&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;You can pull the description from the enum with code like this.&amp;#160; (Keep in mind that you can make this MUCH faster using DynamicMethods and caching, but that is another article…)&lt;/p&gt;

&lt;div id="CodeTitleBar" style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; word-spacing: normal; padding-top: 3px; border-bottom: black 1px dashed; white-space: nowrap; letter-spacing: normal; height: 25px; background-color: #eeeeee"&gt;
  &lt;div style="float: right; text-align: right"&gt;&lt;a onmouseover="window.status=&amp;#39;Copy this code&amp;#39;;return true;" style="text-decoration: none" onmouseout="window.status=&amp;#39;&amp;#39;;return true;" href="javascript:window.clipboardData.setData('Text', document.getElementById('0ef11219-9468-480c-bd2e-4cc41b0cdd80').innerText);void(0)"&gt;&lt;img src="http://static.flickr.com/88/267822310_ee69af9633_m.jpg" align="middle" border="0" /&gt;&amp;#160;&amp;#160; &lt;font face="Arial"&gt;&lt;/font&gt;&lt;font size="1"&gt;Copy Code&lt;/font&gt; &lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div id="0ef11219-9468-480c-bd2e-4cc41b0cdd80" style="padding-right: 5px; padding-left: 5px; overflow-x: scroll; padding-bottom: 5px; padding-top: 5px"&gt;
  &lt;div style="font-size: 10pt; color: black; font-family: courier new"&gt;
    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;const&lt;/span&gt; &lt;span style="color: blue"&gt;char&lt;/span&gt; ENUM_SEPERATOR_CHARACTER = &lt;span style="color: #a31515"&gt;','&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &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;string&lt;/span&gt; GetDescription(&lt;span style="color: #2b91af"&gt;Enum&lt;/span&gt; value)&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Check for Enum that is marked with FlagAttribute&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; entries = value.ToString().Split(ENUM_SEPERATOR_CHARACTER);&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; description = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt;[entries.Length];&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; i = 0; i &amp;lt; entries.Length; i++)&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; fieldInfo = value.GetType().GetField(entries[i].Trim());&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; attributes = (&lt;span style="color: #2b91af"&gt;DescriptionAttribute&lt;/span&gt;[])fieldInfo.GetCustomAttributes(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;DescriptionAttribute&lt;/span&gt;), &lt;span style="color: blue"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; description[i] = (attributes.Length &amp;gt; 0) ? attributes[0].Description : entries[i].Trim();&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;.Join(&lt;span style="color: #a31515"&gt;&amp;quot;, &amp;quot;&lt;/span&gt;, description);&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Well, now with .NET 3.5 and Extension methods it only makes sense to make this a little bit easier.&lt;/p&gt;

&lt;div id="CodeTitleBar" style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; word-spacing: normal; padding-top: 3px; border-bottom: black 1px dashed; white-space: nowrap; letter-spacing: normal; height: 25px; background-color: #eeeeee"&gt;
  &lt;div style="float: right; text-align: right"&gt;&lt;a onmouseover="window.status=&amp;#39;Copy this code&amp;#39;;return true;" style="text-decoration: none" onmouseout="window.status=&amp;#39;&amp;#39;;return true;" href="javascript:window.clipboardData.setData('Text', document.getElementById('d95686f4-46ce-43c8-a785-1674595ed1d1').innerText);void(0)"&gt;&lt;img src="http://static.flickr.com/88/267822310_ee69af9633_m.jpg" align="middle" border="0" /&gt;&amp;#160;&amp;#160; &lt;font face="Arial"&gt;&lt;/font&gt;&lt;font size="1"&gt;Copy Code&lt;/font&gt; &lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div id="d95686f4-46ce-43c8-a785-1674595ed1d1" style="padding-right: 5px; padding-left: 5px; overflow-x: scroll; padding-bottom: 5px; padding-top: 5px"&gt;
  &lt;div style="font-size: 10pt; color: black; font-family: courier new"&gt;
    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &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;string&lt;/span&gt; Description(&lt;span style="color: blue"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Enum&lt;/span&gt; value)&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; GetDescription(value);&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And now you can do the following:&lt;/p&gt;

&lt;div id="CodeTitleBar" style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; word-spacing: normal; padding-top: 3px; border-bottom: black 1px dashed; white-space: nowrap; letter-spacing: normal; height: 25px; background-color: #eeeeee"&gt;
  &lt;div style="float: right; text-align: right"&gt;&lt;a onmouseover="window.status=&amp;#39;Copy this code&amp;#39;;return true;" style="text-decoration: none" onmouseout="window.status=&amp;#39;&amp;#39;;return true;" href="javascript:window.clipboardData.setData('Text', document.getElementById('883d265b-b66b-4330-91ba-c6a8df4cd293').innerText);void(0)"&gt;&lt;img src="http://static.flickr.com/88/267822310_ee69af9633_m.jpg" align="middle" border="0" /&gt;&amp;#160;&amp;#160; &lt;font face="Arial"&gt;&lt;/font&gt;&lt;font size="1"&gt;Copy Code&lt;/font&gt; &lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div id="883d265b-b66b-4330-91ba-c6a8df4cd293" style="padding-right: 5px; padding-left: 5px; overflow-x: scroll; padding-bottom: 5px; padding-top: 5px"&gt;
  &lt;div style="font-size: 10pt; color: black; font-family: courier new"&gt;
    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; secretIdentity = &lt;span style="color: #2b91af"&gt;SuperHero&lt;/span&gt;.Superman.Description();&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; superHeroes = &lt;span style="color: #2b91af"&gt;SuperHero&lt;/span&gt;.Superman | &lt;span style="color: #2b91af"&gt;SuperHero&lt;/span&gt;.SpiderMan;&lt;/pre&gt;

    &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; secretIdentities = superHeroes.Description();&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Note that the code handles Enum marked with the FlagAttribute as well.&amp;#160; The output of the whole flag thing is not ideal but at least it does not break when handling those Enums.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6384818" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /></entry><entry><title>Windows Live Writer Technical Preview</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2008/06/04/windows-live-writer-technical-preview.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2008/06/04/windows-live-writer-technical-preview.aspx</id><published>2008-06-04T19:06:40Z</published><updated>2008-06-04T19:06:40Z</updated><content type="html">&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bhouse/WindowsLiveWriter/WindowsLiveWriterTechnicalPreview_D46D/wlw_techical_preview.png"&gt;&lt;img title="wlw_techical_preview" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="238" alt="wlw_techical_preview" src="http://weblogs.asp.net/blogs/bhouse/WindowsLiveWriter/WindowsLiveWriterTechnicalPreview_D46D/wlw_techical_preview_thumb.png" width="273" align="right" border="0" /&gt;&lt;/a&gt; Microsoft has released a &lt;a href="http://windowslivewriter.spaces.live.com/Blog/cns!D85741BB5E0BE8AA!1508.entry" target="_blank"&gt;technical preview of their new version of Windows Live Writer&lt;/a&gt;.&amp;#160; It has a bunch of new features that you need to check out.&amp;#160; WLW is already the best blog posting software out there (and it’s free!).&amp;#160; &lt;/p&gt;  &lt;p&gt;I have listed some of the new features that are in this build but I have to say, the best new feature IMHO, is something that is not even listed in the official release notes.&amp;#160; That feature is the ability to organize your draft posts any way you want on your hard drive and be able to edit them by simply opening them from windows explorer.&amp;#160; I know that might not seem like a huge deal to some people, but I like to lay out my ideas and draft posts in folders and sub-folders based on topics or tags.&amp;#160; In previous versions, if you attempted to load a draft post from any other folder other than the official drafts folder, you would get a new draft post instead of editing an existing one.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ffa54a"&gt;Note:&amp;#160; You still cannot manage your draft posts (other than the ones that exist in the official drafts folder) from within WLW.&amp;#160; But I am hoping that this feature will be coming in a future build.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Awesome work WLW Team!&lt;/p&gt;  &lt;h3&gt;&lt;b&gt;New Features&lt;/b&gt;&lt;/h3&gt;  &lt;p&gt;You’ll also get an early look at some improvements and new features we’ve been working on: &lt;/p&gt;  &lt;h5&gt;Video and Image Publishing Enhancements&lt;/h5&gt;  &lt;ul&gt;   &lt;li&gt;Upload videos to Soapbox &lt;/li&gt;    &lt;li&gt;Image cropping and tilting &lt;/li&gt;    &lt;li&gt;Additional border styles &lt;/li&gt;    &lt;li&gt;Support for &lt;a&gt;&lt;/a&gt;&lt;a href="http://www.huddletogether.com/projects/lightbox/"&gt;LightBox&lt;/a&gt; and other image previewing effects (like Slimbox, Smoothbox, and others) &lt;/li&gt;    &lt;li&gt;Support for centering images &lt;/li&gt; &lt;/ul&gt;  &lt;h5&gt;Editing Enhancements &lt;/h5&gt;  &lt;ul&gt;   &lt;li&gt;Auto Linking &lt;/li&gt;    &lt;li&gt;Smart quotes/typographic characters &lt;/li&gt;    &lt;li&gt;Word count &lt;/li&gt; &lt;/ul&gt;  &lt;h5&gt;UI Improvements&lt;/h5&gt;  &lt;ul&gt;   &lt;li&gt;Revised main toolbar &lt;/li&gt;    &lt;li&gt;Tabs for view switching &lt;/li&gt;    &lt;li&gt;Improved category control with search/filtering &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;via &lt;a href="http://dragonstyle.typepad.com/links/2008/06/windows-live-wr.html" target="_blank"&gt;Charles Teague’s DragonStyle Blog&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6248147" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author></entry><entry><title>.NET Framework 3.0 RC is out</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/09/01/.NET-Framework-3.0-RC-is-out.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/09/01/.NET-Framework-3.0-RC-is-out.aspx</id><published>2006-09-02T01:01:24Z</published><updated>2006-09-02T01:01:24Z</updated><content type="html">&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;hr&gt;

&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://blogs.msdn.com/jasonz/archive/2006/09/01/735796.aspx"&gt;&lt;strong&gt;&lt;font color="#000080"&gt;.NET Framework 3.0 RC ready for download&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;Via Jason Zander's WebLog - &lt;/font&gt;&lt;/span&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;NETFX 3.0 just went live on the web today, you can download it &lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=19E21845-F5E3-4387-95FF-66788825C1AF&amp;amp;displaylang=en"&gt;&lt;font color="#2f6eb9" size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&amp;nbsp; NETFX 3.0 contains Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow, and Windows Cardspace.&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;You can find out more information about the Go Live program &lt;a href="http://msdn.microsoft.com/winfx/downloads/products/golive/default.aspx"&gt;&lt;font color="#2f6eb9"&gt;here&lt;/font&gt;&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Finally, you can also download the SDK for this release &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=117ECFD3-98AD-4D67-87D2-E95A8407FA86&amp;amp;displaylang=en"&gt;&lt;font color="#2f6eb9"&gt;here&lt;/font&gt;&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Congrats to the team for reaching this important milestone!&amp;nbsp; I'm looking forward to the feedback on release.&amp;nbsp; Tell us how it is going for you!&lt;/font&gt;&lt;/p&gt;&lt;img height="1" src="http://blogs.msdn.com/aggbug.aspx?PostID=735796" width="1" /&gt; 
&lt;div class="item-footer"&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://blogs.msdn.com/jasonz/default.aspx"&gt;&lt;font color="#2f6eb9"&gt;Jason Zander's WebLog&lt;/font&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999" size="2"&gt;Friday, September 01, 2006&lt;/font&gt;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=512063" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /></entry><entry><title>Frans Bouma article about why a cache in an O/R mapper doesn't make it fetch data faster. </title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/31/Frans-Bouma-article-about-why-a-cache-in-an-O_2F00_R-mapper-doesn_2700_t-make-it-fetch-data-faster.-.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/31/Frans-Bouma-article-about-why-a-cache-in-an-O_2F00_R-mapper-doesn_2700_t-make-it-fetch-data-faster.-.aspx</id><published>2006-08-31T16:41:11Z</published><updated>2006-08-31T16:41:11Z</updated><content type="html">&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://weblogs.asp.net/fbouma/archive/2006/08/31/Why-a-cache-in-an-O_2F00_R-mapper-doesn_2700_t-make-it-fetch-data-faster_2E00_.aspx"&gt;&lt;strong&gt;&lt;font color="#000080"&gt;Why a cache in an O/R mapper doesn't make it fetch data faster.&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;Via Frans Bouma's blog - &lt;/font&gt;&lt;/span&gt;
&lt;p&gt;&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;One of the biggest myths in O/R mapper land is about 'caching'. It's often believed that using a cache inside an O/R mapper makes queries much faster and thus makes the O/R mapper more efficient. With that conclusion in hand, every O/R mapper which doesn't use a cache is therefore less efficient than the ones who do, right?&lt;br /&gt;&lt;br /&gt;Well... not exactly. In this article I hope to explain that caching in O/R mappers is not there for making queries more efficient, but is there for &lt;i&gt;uniquing&lt;/i&gt;. But more on that later on. I hope that at the end of the article, I have convinced the reader that the myth &lt;i&gt;Caching == more efficiency&lt;/i&gt; is indeed a myth. Beware, it's perhaps a bit complicated here and there, I'll try to explain it in as much layman's terms as possible. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;What's a cache?&lt;/b&gt;&lt;br /&gt;Before I can explain what a cache is, it's important to understand what an entity is, what an entity instance is etc. Please consult &lt;a href="http://weblogs.asp.net/fbouma/archive/2006/08/23/Essay_3A00_-The-Database-Model-is-the-Domain-Model.aspx"&gt;&lt;font color="#2f6eb9"&gt;this article&lt;/font&gt;&lt;/a&gt; first to learn about what's meant with these terms. &lt;br /&gt;&lt;br /&gt;A &lt;i&gt;cache&lt;/i&gt; is an object store which manages objects so you don't have to re-instantiate objects over and over again, you can just re-use the instance you need from the cache. A cache of an O/R mapper caches entity objects. Pretty simple actually. When an entity is fetched from the persistent storage (i.e. the database), the entity object (i.e. the entity class instance which contains the entity instance (== data)) which contains the data fetched, is stored in the cache, if it's not there already. What exactly does that mean: "if it's not there already" ? It means that the entity &lt;i&gt;object&lt;/i&gt; isn't there yet. &lt;br /&gt;&lt;br /&gt;Caches in O/R mappers are above all used for a concept which is called &lt;i&gt;uniquing&lt;/i&gt;. Uniquing is about having a single entity &lt;i&gt;object&lt;/i&gt; for every entity (== data) loaded. This means that if you load the entity of type Customer and with PK "CHOPS" from the Northwind database, it gets stored in an entity &lt;i&gt;object&lt;/i&gt;, namely an instance of the Customer entity class. What happens if you load the same entity with PK "CHOPS" &lt;i&gt;again&lt;/i&gt; in another instance of the Customer entity class? You would end up with two instances of the same class, but with the &lt;i&gt;same&lt;/i&gt; data. So effectively the &lt;i&gt;objects&lt;/i&gt; represent the same entity. &lt;br /&gt;&lt;br /&gt;This doesn't have to be a problem. Most actions on entities don't require a unique entity &lt;i&gt;object&lt;/i&gt;. After all, they're all mirrors of the &lt;i&gt;real&lt;/i&gt; entities in the database and with a multi-appdomain application (like desktop applications accessing the same database or a multi-webserver using webapplication) you have the chance of having multiple entity objects containing the same entity data anyway.&lt;br /&gt;&lt;br /&gt;However sometimes it can be a problem or an inconvenience. When that happens, it's good that there's a way to have &lt;i&gt;unique&lt;/i&gt; objects per entity loaded. Most O/R mappers use a cache for this: when an entity is loaded from the database, the cache is consulted if there's already an entity object with the entity data of the same entity fetched. If that's the case, that instance is updated with the data read from the database, and that instance is returned as the object holding the data. If there's no object already containing the same &lt;i&gt;entity&lt;/i&gt;, a new instance is created, the entity data fetched is stored in that instance, that instance is stored in the cache and the instance is returned. This leads to &lt;i&gt;unique&lt;/i&gt; objects per entity.&lt;br /&gt;&lt;br /&gt;Not all O/R mappers use a cache for uniquing however, or don't call it a 'cache'. You see, a central cache is really a very generalizing. What if you need for a given &lt;i&gt;semantical context&lt;/i&gt; a unique entity, and outside that context you don't need a unique instance or a different, unique instance? Some O/R mappers, like &lt;a href="http://www.llblgen.com/" target="_blank"&gt;&lt;font color="#2f6eb9"&gt;LLBLGen Pro&lt;/font&gt;&lt;/a&gt;, use &lt;i&gt;Context&lt;/i&gt; objects which provide uniquing for a semantical context, e.g. inside a wizard or an edit form. All entity objects inside that &lt;i&gt;context&lt;/i&gt; are stored in unique objects. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Caches and queries: more overhead than efficiency&lt;/b&gt;&lt;br /&gt;So, when does this efficiency the myth talks about occur exactly? Well, &lt;i&gt;almost&lt;/i&gt; never. In fact, using a cache is often &lt;i&gt;less&lt;/i&gt; efficient. I said &lt;i&gt;almost&lt;/i&gt;, as there are situations where a cache can help, though these are minor or require a lot of consessions. However I'll discuss them as well so you have a complete picture.&lt;br /&gt;&lt;br /&gt;Let's state I have a cache in my O/R mapper and I want to see, by using theory, how efficient it might be. So I have my application running for a given period of time, which means that the cache contains a number of entity objects. My application is a CRM application, so at a given time T the user wants to view all customers who have placed at least 5 orders in the last month. This leads thus to a query for all customer entities which have at least 5 related order entities which are placed in the last month.&lt;br /&gt;&lt;br /&gt;What to do? What would be &lt;i&gt;logical&lt;/i&gt; and &lt;i&gt;correct&lt;/i&gt;? Obviously: fetching the data from the persistent storage, as the entities live there, and only then we'll get all &lt;i&gt;known&lt;/i&gt; and valid customer entities matching the query. We can consult our cache first, but we'll never know if the entities in the cache are all the entities matching my query: what if there are many more in the database, matching the query? So we can't rely on the cache alone, we always have to consult with the persistent storage as well. &lt;br /&gt;&lt;br /&gt;This thus causes a roundtrip &lt;i&gt;and&lt;/i&gt; a query execution on the database. As roundtrips and query executions are a big bottleneck of the complete entity fetch pipeline, the efficiency the myth talks about is nowhere in sight. But it gets worse. &lt;i&gt;With&lt;/i&gt; a cache, there's actually &lt;i&gt;more&lt;/i&gt; overhead. This is caused by the uniquing feature of a cache. So every entity fetched from the database matching the query for the customers has to be checked with the cache: is there already an instance available? If so, update the field values and return that instance, if not, create a new instance (but that's to be done anyway) and store it in the cache. &lt;br /&gt;&lt;br /&gt;So effectively, it has more overhead, as it has to consult the cache for each entity fetched, as well as store all new entities into the cache. Storing entities inside a cache is mostly done with hashvalues calculated from the PK values and stored per type. As hashvalues can result in duplicates (it's just an int32 in most cases) and compound PKs can complicate the calculation process, it's not that straight forward to get the lookup process of entities very efficient. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Some tricks can help... a bit and for a price&lt;/b&gt;&lt;br /&gt;Before I get burned down to the ground, let me say that there are some tricks to speed things up a bit. I have to say "a bit" because it comes at a high price: you've to store a version field in every entity and the O/R mapper of choice must support that version field. This thus means that you've no freedom over how the entities look like or how your datamodel looks like. This is a high price to pay, but perhaps it's something you don't care about. The trick is that instead of returning the full resultset in the &lt;i&gt;first&lt;/i&gt; query execution, only the PK values and the version values are returned for every entity matching the query. By checking the cache, you use the version value to see if an entity has been changed in the db since it was fetched and stored in the cache. If it's not changed, I don't have to fetch the full entity, as the data is already in the cache. If it is changed or not in the cache at all, I've to fetch the full entity. So then I will fetch all entities matching the PKs I've collected from my cache investigation. The advantage of this is that it might be that the second query is very quick. It however also can bomb: what if you're using oracle and you have 3000 customers matching your query? You then can't use an WHERE customerid IN (:a, :b, ...) query as you'll be exceeding the limit of parameters to send in a single query. It also will cause a second query run, which might add actually &lt;i&gt;more&lt;/i&gt; time than simply doing a single fetch: first the PK-Version fetch query has to be run, then the second full fetch query (which might result in less rows, but still...). &lt;br /&gt;&lt;br /&gt;You might wonder: what if I control all access to the database? Then I &lt;i&gt;know&lt;/i&gt; when an entity is saved, and thus can keep track of when which entities are changed as well and thus can make assumptions based on that info whether an entity is updated or not! Well, that's true, but that's not scaling very well. Unlike Java, .NET doesn't have a proper cross-appdomain object awareness system. This means that if you have even two systems targeting the same database (webfarm, multiple desktops), you can't use this anymore. And even if you're in the situation where it could help (single appdomain targeting single database), it's still takes time to get things up to steam: until all entities of a given type are inside the cache, you still have to fetch from the database. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Cache and single entity fetches&lt;/b&gt;&lt;br /&gt;There is one situation where a cache &lt;i&gt;could&lt;/i&gt; help and be more efficient. That is: if you know or assume the data you might find in a cache is 'up to date' enough for you to be used. That situation is with single entity fetches using a PK value. Say the user of our previously mentioned CRM application wants to see the details of the customer with PK value "CHOPS". So all what should happen is an entity fetch by using the PK value "CHOPS". Consulting the cache, it appears that the entity with the PK value "CHOPS" is already loaded and available in the cache! Aren't we lucky today! &lt;br /&gt;&lt;br /&gt;Again, what to do? What's logical in this situation? Pick the one from the cache, or consult the database and run the risk of fetching the exact same entity data as is already contained in the entity object in the cache? I'd say: go to the database. You only know for sure you're working with the right data by consulting the persistent storage. If you pick the one from the cache, you might run the risk that another user has updated the customer data and you're working with outdated, actually &lt;i&gt;wrong&lt;/i&gt; data which could lead to &lt;i&gt;wrong&lt;/i&gt; conclusions while you could have made the right conclusions if you would have looked at the right data. If you pick the one from the database, you might run the risk of burning a few cycles which turned out to be unnecessary. A trick here could be that if the entity in the cache is fetched X seconds ago, it's still considered 'fresh enough', as all data outside the database is &lt;i&gt;stale&lt;/i&gt; the moment it's read anyway. But if correctness is in order, you can't be more sure than by reading from the database and bypass the cache. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;So what's left of this efficiency?&lt;/b&gt;&lt;br /&gt;Well, not much. We've seen that it actually adds more overhead than efficiency, so it's even less efficient than not using a cache. We've seen that it could be solved in a way which could lead to more efficiency but only in a small group of situations and required consessions you're likely not willing to make. We've also seen that a cache could be more efficient in single-entity fetches, but only if you're willing to sacrifice correctness, &lt;i&gt;or&lt;/i&gt; if you're sure the data in your cache is valid enough. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Are caches then completely bogus? Why do O/R mappers often have a cache?&lt;/b&gt;&lt;br /&gt;They're not bogus, they're just used for a different feature than efficiency: uniquing. Some O/R mappers even use the cache for tracking changes on entity objects (and thus the entities inside these objects). Claiming that the cache is making the O/R mapper more efficient is simply giving the wrong message: it &lt;i&gt;could&lt;/i&gt; be a bit more efficient in a small group of situations, and is often giving more overhead than efficiency. &lt;/p&gt;
&lt;p&gt;I hope with this article that people stop spreading this myth and realize why caches (or contexts or whatever they're called in the O/R mapper at hand) in O/R mappers are used for uniquing, and not for object fetch efficiency. &lt;/p&gt;
&lt;div class="shareblock"&gt;&lt;font color="#2f6eb9"&gt;&lt;img height="1" src="http://weblogs.asp.net/aggbug.aspx?PostID=507979" width="1" /&gt;&lt;/font&gt; &lt;/div&gt;
&lt;div class="item-footer"&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://weblogs.asp.net/fbouma/default.aspx"&gt;&lt;font color="#2f6eb9"&gt;Frans Bouma's blog&lt;/font&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999" size="2"&gt;Thursday, August 31, 2006&lt;/font&gt;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=508186" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /></entry><entry><title>How to detect old versions when deploying the .NET Framework 3.0 (formerly WinFX) </title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/31/How-to-detect-old-versions-when-deploying-the-.NET-Framework-3.0-_2800_formerly-WinFX_2900_-.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/31/How-to-detect-old-versions-when-deploying-the-.NET-Framework-3.0-_2800_formerly-WinFX_2900_-.aspx</id><published>2006-08-31T16:35:11Z</published><updated>2006-08-31T16:35:11Z</updated><content type="html">&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://blogs.msdn.com/astebner/archive/2006/08/31/732598.aspx"&gt;&lt;strong&gt;&lt;font color="#000080"&gt;How to detect old versions when deploying the .NET Framework 3.0 (formerly WinFX)&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;Via Aaron Stebner's WebLog - &lt;/font&gt;&lt;/span&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;I received an interesting question from a customer this weekend.&amp;nbsp; They are working on a setup package that will include the .NET Framework 3.0 (formerly the WinFX runtime components) as a prerequisite, and they wanted to automatically run the &lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AAE7FC63-D405-4E13-909F-E85AA9E66146&amp;amp;displaylang=en"&gt;&lt;font face="Verdana" color="#2f6eb9" size="2"&gt;vs_uninst_winfx.exe cleanup tool&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; to make sure that there were not any previous beta versions on the system that would cause setup to fail.&amp;nbsp; This cleanup tool does not have any silent switches, and it is only designed as an end user tool and not a redistributable setup component, so I advised the customer against including this.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;However, it is possible to implement logic in a setup wrapper to accomplish the underlying goal of ensuring that no previous beta versions are present on the system.&amp;nbsp; I &lt;/font&gt;&lt;a href="http://blogs.msdn.com/astebner/archive/2006/04/30/587352.aspx"&gt;&lt;font face="Verdana" color="#2f6eb9" size="2"&gt;previously outlined an algorithm&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; to accomplish this for the .NET Framework 2.0, and a similar algorithm will also work for the .NET Framework 3.0.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Here is an overview of the algorithm that .NET Framework 2.0 and 3.0 setup use to determine whether any previous beta products are on the system:&lt;/font&gt;&lt;/p&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;For each (beta product code)&lt;br /&gt;{&lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;Call &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiqueryproductstate.asp"&gt;&lt;font face="Verdana" color="#2f6eb9" size="2"&gt;MsiQueryProductState&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; to check if the install state for the product code equals INSTALLSTATE_DEFAULT&lt;/font&gt;&lt;/p&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;if (install state == INSTALLSTATE_DEFAULT)&lt;br /&gt;{&lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;Call &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msigetproductinfo.asp"&gt;&lt;font face="Verdana" color="#2f6eb9" size="2"&gt;MsiGetProductInfo&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; to retrieve the INSTALLPROPERTY_INSTALLEDPRODUCTNAME property for the product code&lt;br /&gt;Add the value of the INSTALLPROPERTY_INSTALLEDPRODUCTNAME property to the list of beta products that need to be uninstalled&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;If (list of beta products is not empty)&lt;br /&gt;{&lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;If (setup is running in full UI mode)&lt;br /&gt;{&lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;Display UI with a list of product names that need to be uninstalled via Add/Remove Programs&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;Exit setup with &lt;/font&gt;&lt;a href="http://blogs.msdn.com/astebner/archive/2005/12/07/501381.aspx"&gt;&lt;font face="Verdana" color="#2f6eb9" size="2"&gt;return code 4113&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;The difference between the .NET Framework 2.0 and 3.0 is the location of the list of beta product codes.&amp;nbsp; You can find the beta product codes for the .NET Framework 3.0 by using these steps:&lt;/font&gt;&lt;/p&gt;
&lt;ol dir="ltr"&gt;
&lt;li&gt;
&lt;div style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;Download the .NET Framework 3.0 &lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=62057A6F-185F-41DB-ABE5-678F6FC388F0&amp;amp;displaylang=en"&gt;&lt;font face="Verdana" color="#2f6eb9" size="2"&gt;web&amp;nbsp;download bootstrapper&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; and save it to your hard drive&lt;/font&gt;&lt;/div&gt;
&lt;li&gt;
&lt;div style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;Extract the contents by running dotnetfx3setup.exe /x:c:\dotnetfx3&lt;/font&gt;&lt;/div&gt;
&lt;li&gt;
&lt;div style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;Open the file c:\dotnetfx3\setup.sdb in a text editor such as notepad&lt;/font&gt;&lt;/div&gt;
&lt;li&gt;
&lt;div style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;Look for the list of product codes in the [PrevProductIds] section of setup.sdb&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p style="MARGIN-RIGHT: 0px"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;img height="1" src="http://blogs.msdn.com/aggbug.aspx?PostID=732598" width="1" /&gt; 
&lt;div class="item-footer"&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://blogs.msdn.com/astebner/default.aspx"&gt;&lt;font color="#2f6eb9"&gt;Aaron Stebner's WebLog&lt;/font&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999" size="2"&gt;Thursday, August 31, 2006&lt;/font&gt;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=508179" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /></entry><entry><title>DSL Tools V1 to ship with Visual Studio SDK V3 in first part of September</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/31/DSL-Tools-V1-to-ship-with-Visual-Studio-SDK-V3-in-first-part-of-September.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/31/DSL-Tools-V1-to-ship-with-Visual-Studio-SDK-V3-in-first-part-of-September.aspx</id><published>2006-08-31T16:29:34Z</published><updated>2006-08-31T16:29:34Z</updated><content type="html">&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://blogs.msdn.com/stuart_kent/archive/2006/08/31/733372.aspx"&gt;&lt;strong&gt;&lt;font color="#000080"&gt;DSL Tools V1 release - latest news&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;via stuart kent's blog - &lt;/font&gt;&lt;/span&gt;
&lt;p&gt;Having just returned from vacation, I thought I'd update folks about the V1 release of DSL Tools. This will be shipped as part of the Visual Studio 2005 SDK Version 3 in the first part of September.&lt;/p&gt;
&lt;p&gt;We have signed, sealed and delivered our code to the VS SDK team who are now just wrapping up. There will be a significant new documentation drop at the same time, although we will continue to update the documentation until the end of the year.&lt;/p&gt;
&lt;p&gt;Apart from bug fixes, the main feature in this release is a completed Dsl Designer for editing .dsl definitions.&lt;/p&gt;
&lt;p&gt;I'll post again as soon as the toolkit has been released.&lt;/p&gt;&lt;img height="1" src="http://blogs.msdn.com/aggbug.aspx?PostID=733372" width="1" /&gt; 
&lt;div class="item-footer"&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://blogs.msdn.com/stuart_kent/default.aspx"&gt;&lt;font color="#2f6eb9"&gt;stuart kent's blog&lt;/font&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999" size="2"&gt;Thursday, August 31, 2006&lt;/font&gt;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=508168" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /></entry><entry><title>WCF and WCF Security Guidance Packages Released.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/31/WCF-and-WCF-Security-Guidance-Packages-Released_2E00_.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/31/WCF-and-WCF-Security-Guidance-Packages-Released_2E00_.aspx</id><published>2006-08-31T11:15:53Z</published><updated>2006-08-31T11:15:53Z</updated><content type="html">&lt;p&gt;You can go to &lt;a title="http://www.gotdotnet.com/codegallery/releases/viewuploads.aspx?id=6fde9247-53a8-4879-853d-500cd2d97a83" href="http://www.gotdotnet.com/codegallery/releases/viewuploads.aspx?id=6fde9247-53a8-4879-853d-500cd2d97a83" target="_blank"&gt;the download page here&lt;/a&gt;.&amp;nbsp;&amp;nbsp; On the download page you will also find an excel spreadsheet which has features that are planned for the December CTP release of Service Factory.&lt;/p&gt;
&lt;p&gt;
&lt;hr&gt;

&lt;p&gt;&lt;/p&gt;
&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=6fde9247-53a8-4879-853d-500cd2d97a83&amp;amp;newsId=55a3cdfa-ccf4-4424-a046-83e0a5fe23e4"&gt;&lt;strong&gt;&lt;font color="#000080"&gt;WCF Guidance Packages available for download!&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;Via patterns &amp;amp; practices: Service Factory : News - &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;/span&gt;If you have the July CTP of .NET 3.0 installed and have been wanting to use Service Factory to create WCF services, I am now happy to encourage you to do so :) This release only includes 2 guidance packages (GP): the main WCF GP and the WCF security GP. The Data Access GP that is part of the Service Factory July release will work with these guidance packages. &lt;br /&gt;&lt;br /&gt;We have not included the reference implementation (RI) because we expect it will change considerably from the RI that is part of the July Service Factory release. We are also not including documentation in this drop. The plan we are shooting for (from not until we release in December) is to drop GPs and the RI once a month and to also drop the written guidance once a month but 2 weeks apart. As always, we are interested in your feedback on this approach. &lt;br /&gt;&lt;br /&gt;We have also changed how we are exposing our known issues from now on. In an effort to be even more transparent into our project, I am making all of the known issues available to you. If you run into a issue, just open the ServiceFactoryKnownIssues-Aug.xls file and using the find feature (Ctrl-F) to find the issue you are experiencing. If you don't have Microsoft Excel installed, see the installation instructions for a download link to the Excel 2003 Viewer. Naturally, we are interested in your feedback about this also. &lt;/div&gt;
&lt;div class="item-content"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="item-footer"&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=6fde9247-53a8-4879-853d-500cd2d97a83"&gt;&lt;font color="#2f6eb9"&gt;patterns &amp;amp; practices: Service Factory : News&lt;/font&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999" size="2"&gt;Thursday, August 31, 2006&lt;/font&gt;&lt;/span&gt; &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=507706" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /></entry><entry><title>What's the difference between working on an open source project and working on a paid job</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/30/What_2700_s-the-difference-between-working-on-an-open-source-project-and-working-on-a-paid-job.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/30/What_2700_s-the-difference-between-working-on-an-open-source-project-and-working-on-a-paid-job.aspx</id><published>2006-08-31T00:20:13Z</published><updated>2006-08-31T00:20:13Z</updated><content type="html">&lt;p&gt;&lt;a title="http://tortoisesvn.net/blog/3" href="http://tortoisesvn.net/blog/3" target="_blank"&gt;Steve King&lt;/a&gt; (author of &lt;a title="http://tortoisesvn.net/" href="http://tortoisesvn.net/" target="_blank"&gt;TortoiseSVN&lt;/a&gt;) has &lt;a title="http://tortoisesvn.net/difference_opensource_paidjob" href="http://tortoisesvn.net/difference_opensource_paidjob" target="_blank"&gt;an interesting article &lt;/a&gt;on the differences between working on his open source project and his paid job.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=506783" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/bhouse/archive/tags/General+Software+Development/default.aspx" /></entry><entry><title>Interesting interview question</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/30/Interesting-interview-question.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/30/Interesting-interview-question.aspx</id><published>2006-08-30T12:33:20Z</published><updated>2006-08-30T12:33:20Z</updated><content type="html">&lt;div&gt;&lt;em&gt;Hamilton Verissimo posts details about an interesting interview questions&lt;/em&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://hammett.castleproject.org/?p=49"&gt;&lt;strong&gt;&lt;font color="#000080"&gt;Interesting snippet&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;Via Zen and the art of Castle maintenance - &lt;/font&gt;&lt;/span&gt;
&lt;p&gt;&lt;a href="http://www.ayende.com/Blog/"&gt;&lt;font color="#2f6eb9"&gt;Ayende&lt;/font&gt;&lt;/a&gt; has posted an interesting code snippet useful to measure how much a candidate to a job knows about the compiler he/she claims to work on. &lt;/p&gt;&lt;pre&gt;selected = selected++;&lt;/pre&gt;
&lt;p&gt;I&amp;rsquo;ve seen this one years ago (2002 I think) in a Java prep exam. My first guess was that &amp;rsquo;selected&amp;rsquo; variable would hold the result of selected++. Wrong! Then I kind memorized that this one was tricky, but forgot why. But today I was curious enough to check again the IL code to see where is the trick.&lt;/p&gt;
&lt;p&gt;The C# code&lt;/p&gt;&lt;pre&gt;selected = 1;
selected = selected++;&lt;/pre&gt;
&lt;p&gt;The IL&lt;/p&gt;&lt;pre&gt;L_0000: ldc.i4.1 // loads the literal 1
L_0001: stloc.0  // store in the local
L_0002: ldloc.0 // load the local value (1)
L_0003: dup  // duplicates the stack, now we have two ints with value 1
L_0004: ldc.i4.1 // loads the literal 1 (++)
L_0005: add // sum 1 + 1 and push the result on the stack (2)
L_0006: stloc.0 // saves the value 2 on the local variable which is the top level item on the stack
L_0007: stloc.0 // whoops, the int on the stack now is the 1, store it (overriding the result of the increment)
&lt;/pre&gt;
&lt;p&gt;Knowing this kind of behavior might be useful. On the project I was working on I coded something like the following&lt;/p&gt;&lt;pre&gt;int val = 1;
string something = "some value " + (val + ',' + "something else");
&lt;/pre&gt;
&lt;p&gt;Can you the headache this gave me?&lt;/p&gt;
&lt;p&gt;If you have time and likes to read, the book &lt;a href="http://www.amazon.com/gp/product/0126339511/sr=1-1/qid=1156822606/ref=sr_1_1/002-2479043-7774466?ie=UTF8&amp;amp;s=books"&gt;&lt;font color="#2f6eb9"&gt;Programming language pragmatics&lt;/font&gt;&lt;/a&gt; is a gem. &lt;/p&gt;
&lt;div class="item-footer"&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://hammett.castleproject.org/"&gt;&lt;font color="#2f6eb9"&gt;Zen and the art of Castle maintenance&lt;/font&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999" size="2"&gt;Monday, August 28, 2006&lt;/font&gt;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=505237" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /></entry><entry><title>Learn more about your site's status in the Google index.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/29/Learn-more-about-your-site_2700_s-status-in-the-Google-index_2E00_.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/29/Learn-more-about-your-site_2700_s-status-in-the-Google-index_2E00_.aspx</id><published>2006-08-30T01:39:26Z</published><updated>2006-08-30T01:39:26Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.google.com/webmasters/sitemaps/sitestatus"&gt;http://www.google.com/webmasters/sitemaps/sitestatus&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=504157" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/bhouse/archive/tags/General+Software+Development/default.aspx" /><category term="Community News" scheme="http://weblogs.asp.net/bhouse/archive/tags/Community+News/default.aspx" /></entry><entry><title>Pilot invites go out for Microsoft’s AdSense competitor </title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/29/Pilot-invites-go-out-for-Microsoft_1920_s-AdSense-competitor-.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/29/Pilot-invites-go-out-for-Microsoft_1920_s-AdSense-competitor-.aspx</id><published>2006-08-30T01:36:45Z</published><updated>2006-08-30T01:36:45Z</updated><content type="html">&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://feeds.feedburner.com/~r/Techcrunch/~3/17487418/"&gt;&lt;strong&gt;&lt;font color="#000080"&gt;Pilot invites go out for Microsoft&amp;rsquo;s AdSense competitor&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;Via TechCrunch - &lt;/font&gt;&lt;/span&gt;
&lt;p&gt;&lt;a href="https://adcenter.microsoft.com/"&gt;&lt;font color="#999999" size="2"&gt;&lt;img class="shot" style="FLOAT: left" alt="logo" src="http://www.techcrunch.com/wp-content/msnadslogo.jpg" /&gt;&lt;/font&gt;&lt;/a&gt;Microsoft&amp;rsquo;s long awaited contextual advertising platform, named ContentAds, sent out the first invitations today to prospective participants in its pilot program. Starting on &amp;ldquo;primarily&amp;rdquo; (their word) MSN owned sites, Microsoft says that ContentAds will place advertisements using not just keywords but also demographic targeting, geo-targeting and incremental bidding tools. Sounds like AdSense plus some consideration of the demographics of various MSN sites&amp;rsquo; readership - we&amp;rsquo;ll see what happens when ContentAds are released into the wild. We&amp;rsquo;ll probably see soon.&lt;/p&gt;
&lt;p&gt;More big time competition for Google&amp;rsquo;s AdSense, Yahoo! Publisher Network and the other players in the field should mean higher revenue cuts for publishers and more innovation in the way ads are served. That&amp;rsquo;s the theory anyway, though Microsoft&amp;rsquo;s late and safe entry into the game leaves open the question of whether there will be much innovation here. Come on Microsoft - surprise us!&lt;/p&gt;
&lt;p&gt;Online ad expert &lt;a href="http://www.jensense.com/archives/2006/08/msn_adcenter_in.html"&gt;&lt;font color="#2f6eb9"&gt;Jennifer Slegg&lt;/font&gt;&lt;/a&gt;, who got an invitation, broke the news (I found &lt;a href="http://mrwavetheory.blogspot.com/2006/08/microsoft-getting-contextual-with.html"&gt;&lt;font color="#2f6eb9"&gt;via&lt;/font&gt;&lt;/a&gt;) and predicts Microsoft&amp;rsquo;s entry will be especially good news for small publishers without millions of impressions per month. &lt;/p&gt;
&lt;p&gt;Microsoft announced what was &lt;a href="http://www.techcrunch.com/2006/08/23/facebook-does-ad-deal-but-not-with-google/"&gt;&lt;font color="#2f6eb9"&gt;probably a huge advertising deal with Facebook&lt;/font&gt;&lt;/a&gt; just last week. &lt;/p&gt;
&lt;div class="meta"&gt;
&lt;p class="tags"&gt;&lt;a title="See the Technorati tag page for 'ContentAds'." href="http://technorati.com/tag/ContentAds" rel="tag"&gt;&lt;font color="#2f6eb9"&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href="http://feeds.feedburner.com/~a/Techcrunch?a=HYirhb"&gt;&lt;font color="#2f6eb9"&gt;&lt;img src="http://feeds.feedburner.com/~a/Techcrunch?i=HYirhb" border="0" /&gt;&lt;/img&gt;&lt;/font&gt;&lt;/a&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://www.techcrunch.com/"&gt;&lt;font color="#2f6eb9"&gt;TechCrunch&lt;/font&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999" size="2"&gt;Tuesday, August 29, 2006&lt;/font&gt;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=504147" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/bhouse/archive/tags/General+Software+Development/default.aspx" /></entry><entry><title>Clearing Enum Flags</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/29/Clearing-Enum-Flags.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/29/Clearing-Enum-Flags.aspx</id><published>2006-08-30T01:31:53Z</published><updated>2006-08-30T01:31:53Z</updated><content type="html">&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://blogs.msdn.com/kcwalina/archive/2006/08/29/ClearingFlagEnum.aspx"&gt;&lt;strong&gt;&lt;font color="#000080"&gt;Clearing Enum Flags&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;Via Krzysztof Cwalina - &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri"&gt;&lt;font size="4"&gt;Somebody&amp;nbsp;just pointed out to me that the &lt;/font&gt;&lt;a href="http://blogs.msdn.com/kcwalina/archive/2004/05/18/134208.aspx#728982"&gt;&lt;font color="#2f6eb9" size="4"&gt;enum guidelines&lt;/font&gt;&lt;/a&gt;&lt;font size="4"&gt; don&amp;rsquo;t provide any information on how to clear a flag in a flags enum variable. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="4"&gt;This is quite easy to do if the enum has a value (member) that has all the flags set. Such value is usually called All.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;[&lt;span style="COLOR: teal"&gt;Flags&lt;/span&gt;]&lt;?xml:namespace prefix ="" o ns ="" "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;span style="COLOR: blue"&gt;enum&lt;/span&gt; &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;A = 1,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;B = 2,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;C = 4, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;D = 8,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;AB = A | B,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CD = C | D,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;All = AB | CD&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;static&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: teal"&gt;Program&lt;/span&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Main() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; value = &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt;.AB;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;.WriteLine(ClearFlag(value,&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt;.A);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; ClearFlag(&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; value, &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; flag) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;value = value &amp;amp; (&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt;.All ^ flag);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; value; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;span style="mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;&lt;font face="Calibri"&gt;&lt;font size="4"&gt;If the enum does not contain the All value, you can manually create it by combining existing flags.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&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: teal"&gt;Foos&lt;/span&gt; ClearFlag(&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; value, &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; flag) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;value = value &amp;amp; ((&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt;.AB|&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt;.CD) ^ flag);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; value;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;span style="mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;&lt;font face="Calibri"&gt;&lt;font size="4"&gt;Or you can manufactore the All value from UInt32.&lt;/font&gt; &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&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: teal"&gt;Foos&lt;/span&gt; ClearFlag(&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; value, &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; flag) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; all;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;unchecked&lt;/span&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&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&gt;all = (&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt;)&lt;span style="COLOR: teal"&gt;UInt32&lt;/span&gt;.MaxValue;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;value = value &amp;amp; (all ^ flag);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; value;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;span style="mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"&gt;&lt;font face="Calibri"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri"&gt;&lt;font size="4"&gt;Keep in mind that not all enums are backed with 32-bit integers. For these that are larger, for example enums with ulong as the underlying type, you will need to use UINt32.MaxValue instead.&lt;/font&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="COLOR: teal"&gt;Flags&lt;/span&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;enum&lt;/span&gt; &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; : &lt;span style="COLOR: blue"&gt;ulong&lt;/span&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;hellip;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; ClearFlag(&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; value, &lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; flag) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt; all;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;unchecked&lt;/span&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&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&gt;all = (&lt;span style="COLOR: teal"&gt;Foos&lt;/span&gt;)&lt;span style="COLOR: teal"&gt;UInt64&lt;/span&gt;.MaxValue;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;value = value &amp;amp; (all ^ flag);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; value;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;font face="Calibri"&gt;&lt;font size="4"&gt;What&amp;rsquo;s interesting is that you don&amp;rsquo;t actually need to change anything if the underlying type is smaller, i.e. you can cast UInt64 to an enum backed with a byte. The cast operator takes care of the size mismatch. This means you could always use UInt64. &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;The only drawback would be that it makes the variable all larger than it has to be, which is a slight inefficiency, probably not detectable in all but the most targeted benchmarks.&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="item-content"&gt;&lt;img height="1" src="http://blogs.msdn.com/aggbug.aspx?PostID=730471" width="1" /&gt; &lt;/div&gt;
&lt;div class="item-footer"&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://blogs.msdn.com/kcwalina/default.aspx"&gt;&lt;font color="#2f6eb9"&gt;Krzysztof Cwalina&lt;/font&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999" size="2"&gt;Tuesday, August 29, 2006&lt;/font&gt;&lt;/span&gt; &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=504144" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /></entry><entry><title>Heralding PLINQ into the LINQ party </title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/29/Heralding-PLINQ-into-the-LINQ-party-.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/29/Heralding-PLINQ-into-the-LINQ-party-.aspx</id><published>2006-08-30T01:24:01Z</published><updated>2006-08-30T01:24:01Z</updated><content type="html">&lt;div&gt;&lt;font size="2"&gt;&amp;nbsp;Sounds interesting.&amp;nbsp; What&amp;rsquo;s weird is that eWEEK is the one with early coverage on it&amp;hellip;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;font size="2"&gt;
&lt;hr&gt;
&lt;/font&gt;
&lt;div class="item" width="100%"&gt;
&lt;div class="item-title"&gt;&lt;a href="http://jonathanbruceconnects.com/jonathan_bruce/2006/08/heralding_plinq_into_linq_part.html"&gt;&lt;strong&gt;&lt;font color="#000080" size="2"&gt;Heralding PLINQ into the LINQ party&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div class="item-content"&gt;&lt;span class="item-source"&gt;&lt;font color="#999999" size="2"&gt;Via Jonathan Bruce's WebLog - &lt;/font&gt;&lt;/span&gt;
&lt;p&gt;&lt;a href="http:///"&gt;&lt;font color="#2f6eb9" size="2"&gt;eWEEK &lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;reports today, the announcement of PLinq. I'll quite directly from the article, as &lt;/font&gt;&lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=202138"&gt;&lt;font color="#2f6eb9" size="2"&gt;Andreas Hejlsberg&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; captures the concept succinctly:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;"With PLinq, effectively you write the code the same way, but we arrange for it to run on multiple CPUs," &lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;...and...&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;"So the queries get split up and run on multiple CPUs, and then you just wait for all the results to arrive. And lo and behold, without any changes your program just ran six times faster. It's instant gratification."&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Sounds very interesting I agree, but my immediate impression are we in danger of over rotating on LINQ, as a concept or perhaps even what it can deliver. I don't wish to draw any comparisons with similar or for that matter dis-similar technologies, but I am ill at ease that we might soon see a a serious outbreak out of mass developer confusion. &lt;/font&gt;&lt;/p&gt;
&lt;div class="item-footer"&gt;&lt;span class="item-subtext" style="FLOAT: right"&gt;&lt;a href="http://jonathanbruceconnects.com/jonathan_bruce/"&gt;&lt;font color="#2f6eb9" size="2"&gt;Jonathan Bruce's WebLog&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;&lt;font size="2"&gt; &lt;span class="item-subtext"&gt;&lt;font color="#999999"&gt;Monday, August 28, 2006&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/div&gt;
&lt;div class="footer"&gt;&lt;a class="onfolio" href="http://toolbar.live.com/onfolio"&gt;&lt;font size="2"&gt;This message was created using &lt;span class="footer-strong"&gt;&lt;strong&gt;Onfolio&lt;/strong&gt;&lt;/span&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;font size="2"&gt;Related articles about PLINQ&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;a href="http://www.eweek.com/article2/0,1895,1860723,00.asp"&gt;Access to Data No Longer the Weakest LINQ&lt;/a&gt;&lt;br /&gt;&lt;/font&gt;&lt;a href="http://www.eweek.com/article2/0%2c1895%2c2009167%2c00.asp"&gt;&lt;font size="2"&gt;Microsoft&amp;rsquo;s PLINQ to Speed Program Execution&lt;br /&gt;&lt;a href="http://jonathanbruceconnects.com/jonathan_bruce/2006/08/heralding_plinq_into_linq_part.html"&gt;Heralding PLINQ into the LINQ party&lt;/a&gt;&lt;br /&gt;&lt;/font&gt;&lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=202138"&gt;&lt;font size="2"&gt;Chatting about LINQ and ADO.NET Entities&lt;/font&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;/a&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=504135" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/bhouse/archive/tags/.NET/default.aspx" /><category term="General Software Development" scheme="http://weblogs.asp.net/bhouse/archive/tags/General+Software+Development/default.aspx" /></entry><entry><title>My next monitor - If I can get my manager to approve the purchase...</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/29/My-next-monitor-_2D00_-If-I-can-get-my-manager-to-approve-the-purchase_2E002E002E00_.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/29/My-next-monitor-_2D00_-If-I-can-get-my-manager-to-approve-the-purchase_2E002E002E00_.aspx</id><published>2006-08-30T01:10:41Z</published><updated>2006-08-30T01:10:41Z</updated><content type="html">&lt;p&gt;&lt;a href="http://blog.scifi.com/tech/archives/2006/08/28/radius_320_moni.html"&gt;http://blog.scifi.com/tech/archives/2006/08/28/radius_320_moni.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://static.flickr.com/89/228736292_a661b0e483.jpg?v=0" border="0" /&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=504095" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/bhouse/archive/tags/General+Software+Development/default.aspx" /></entry><entry><title>Omea Reader 2.x and items showing up under wrong feeds</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/bhouse/archive/2006/08/29/Omea-Reader-2.x-and-items-showing-up-under-wrong-feeds.aspx" /><id>http://weblogs.asp.net/bhouse/archive/2006/08/29/Omea-Reader-2.x-and-items-showing-up-under-wrong-feeds.aspx</id><published>2006-08-29T11:48:30Z</published><updated>2006-08-29T11:48:30Z</updated><content type="html">&lt;p&gt;I am trying out Omea Reader and I really like the UI and ability to create search folders similar to what I had in Outlook.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;However, I am getting a lot of feed items that will show up under the wrong feeds.&amp;nbsp; A lot of the items are duplicates as the item&amp;nbsp;is also under the correct feed.&amp;nbsp; I have tried it with&amp;nbsp;versions 2.1.6 and 2.2 RC4.&amp;nbsp;&amp;nbsp; With a lot of feeds and this happening several times a day, it is getting very annoying.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I noticed that others are having problems with this on JetBrains&amp;rsquo;s newsgroup servers but no one from JetBrain has posted a work around or solution.&lt;/p&gt;
&lt;p&gt;Anyone else have this problem and find a way around it?&amp;nbsp; (other than uninstalling it!)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=502092" width="1" height="1"&gt;</content><author><name>dotnetboy2003</name><uri>http://weblogs.asp.net/members/dotnetboy2003.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/bhouse/archive/tags/General+Software+Development/default.aspx" /></entry></feed>