<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Scott Wojan</title>
        <link>http://geekswithblogs.net/wojan/Default.aspx</link>
        <description>DotRant BLOG</description>
        <language>en-US</language>
        <copyright>Scott Wojan</copyright>
        <managingEditor>wojohnson@rocketmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Scott Wojan</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/wojan/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Capturing HTTP traffic on an iPhone with Fiddler</title>
            <category>fiddler</category>
            <category>iphone</category>
            <category>http proxy</category>
            <link>http://geekswithblogs.net/wojan/archive/2013/05/20/152961.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2013/05/20/152961.aspx'&gt;http://geekswithblogs.net/wojan/archive/2013/05/20/152961.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;
This is a simple update to the &lt;b&gt;&lt;u&gt;great &lt;/u&gt;&lt;/b&gt;entry at &lt;a href="http://conceptdev.blogspot.com/2009/01/monitoring-iphone-web-traffic-with.html"&gt;http://conceptdev.blogspot.com/2009/01/monitoring-iphone-web-traffic-with.html&lt;/a&gt; with the new Fiddler interface.
&lt;/p&gt;
&lt;div class="post-body"&gt;
  &lt;p&gt;
    &lt;br /&gt;
    &lt;b&gt;1. Get Fiddler&lt;/b&gt;&lt;br /&gt;
    &lt;a href="http://www.fiddler2.com/Fiddler2/version.asp" target="20090201"&gt;Download Fiddler&lt;/a&gt; &lt;br /&gt;
    &lt;br /&gt;
    &lt;b&gt;2. Set-up Fiddler&lt;/b&gt;&lt;br /&gt;
    Start Fiddler then open the &lt;code&gt;Tools &amp;gt; Fiddler Options...&lt;/code&gt; window&lt;br /&gt;
    &lt;a href="http://1.bp.blogspot.com/_Ba76y6K7kvs/SYU_H5JSdrI/AAAAAAAAAs4/S2zZe8_e0z4/s1600-h/options-menu.png"&gt;
      &lt;img style="cursor: pointer; cursor: hand;" src="http://gwb.blob.core.windows.net/wojan/Monitoring-HTTP-traffic-with-Fiddler_152961/untitled_1869004160.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5297709941502670514" /&gt;&lt;/a&gt;&lt;br /&gt;
    &lt;br /&gt;
    and in the &lt;code&gt;Connections&lt;/code&gt; tab, ensure: 
    &lt;/p&gt;&lt;ul&gt;
      &lt;li&gt;&lt;code&gt;"Allow remote computers to connect"&lt;/code&gt; is checked.&lt;/li&gt;
      &lt;li&gt;&lt;code&gt;"Act as system proxy on startup&lt;/code&gt;" is checked.&lt;/li&gt;
      &lt;li&gt;Note or change what port is set (eg. &lt;code&gt;8888&lt;/code&gt;).&lt;/li&gt;
    &lt;/ul&gt;
    &lt;br /&gt;
    &lt;a href="http://2.bp.blogspot.com/_Ba76y6K7kvs/SYU_HyP72dI/AAAAAAAAAtA/MjgxzEV4AjE/s1600-h/options-general.png"&gt;
      &lt;img style="cursor: pointer; cursor: hand;" src="http://gwb.blob.core.windows.net/wojan/Monitoring-HTTP-traffic-with-Fiddler_152961/untitled_-1728700224.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5297709939651500498" /&gt;&lt;/a&gt;&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    Once you've saved those settings you need to &lt;b&gt;stop&lt;/b&gt; and &lt;b&gt;re-start&lt;/b&gt; Fiddler.&lt;br /&gt;
    &lt;br /&gt;
    &lt;b&gt;3. Ensure Fiddler is 'listening'&lt;/b&gt;&lt;br /&gt;
    Once Fiddler has re-started, verify that the &lt;code&gt;Capture Traffic&lt;/code&gt; menuitem is ticked.&lt;br /&gt;
    &lt;a href="http://4.bp.blogspot.com/_Ba76y6K7kvs/SYU_H7F5ezI/AAAAAAAAAsw/a82sh6Jp7mg/s1600-h/capture.png"&gt;
      &lt;img style="cursor: pointer; cursor: hand;" src="https://gwb.blob.core.windows.net/wojan/Monitoring-HTTP-traffic-with-Fiddler_152961/untitled_240060416.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5297709942025321266" /&gt;&lt;/a&gt;&lt;br /&gt;
    &lt;br /&gt;
    &lt;b&gt;4. Check the 'listening' IP&lt;/b&gt;&lt;br /&gt;
    You need to know your computer's wireless-network IP address to configure the iPhone. This screenshots shows the &lt;code&gt;Command Prompt &amp;gt; ipconfig&lt;/code&gt; output:&lt;br /&gt;
    &lt;a href="http://2.bp.blogspot.com/_Ba76y6K7kvs/SYU_y1Rzj4I/AAAAAAAAAtY/ANYHKx8Dqm8/s1600-h/cmd+ipconfig.png"&gt;
      &lt;img style="cursor: pointer; cursor: hand; width: 400px; height: 103px;" src="http://2.bp.blogspot.com/_Ba76y6K7kvs/SYU_y1Rzj4I/AAAAAAAAAtY/ANYHKx8Dqm8/s400/cmd+ipconfig.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5297710679199027074" /&gt;&lt;/a&gt;&lt;br /&gt;
    &lt;br /&gt;
    &lt;b&gt;5. Set-up iPhone Settings&lt;/b&gt;&lt;br /&gt;
    With the computer IP address and Fiddler port, go to your iPhone's &lt;code&gt;Wifi Settings&lt;/code&gt; and scroll down to the &lt;code&gt;HTTP Proxy&lt;/code&gt;, choose &lt;code&gt;Manual&lt;/code&gt; and input the Fiddler proxy info:&lt;br /&gt;
    &lt;a href="http://2.bp.blogspot.com/_Ba76y6K7kvs/SYU_IJ-elYI/AAAAAAAAAtQ/UQmw4qO-dwQ/s1600-h/iPhone+Network+Proxy-zoom.png"&gt;
      &lt;img style="cursor: pointer; cursor: hand; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_Ba76y6K7kvs/SYU_IJ-elYI/AAAAAAAAAtQ/UQmw4qO-dwQ/s400/iPhone+Network+Proxy-zoom.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5297709946020730242" /&gt;&lt;/a&gt;&lt;br /&gt;
    (remember to switch back to &lt;b&gt;Off&lt;/b&gt; when you're done)&lt;br /&gt;
    &lt;br /&gt;
    &lt;b&gt;6. 'sniff' away&lt;/b&gt;&lt;br /&gt;
    If everything has been setup right, anything you do in &lt;b&gt;Safari&lt;/b&gt; or other internet based applications will be logged in the Fiddler window.
    &lt;br /&gt;
    &lt;a href="http://1.bp.blogspot.com/_Ba76y6K7kvs/SYVCa3wSatI/AAAAAAAAAtg/MHB2HVfjXBo/s1600-h/Fiddler+window.png"&gt;
      &lt;img style="cursor: pointer; cursor: hand;" src="https://gwb.blob.core.windows.net/wojan/Monitoring-HTTP-traffic-with-Fiddler_152961/untitled_592774912.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5297713566081772242" /&gt;&lt;/a&gt;&lt;br /&gt;
    &lt;br /&gt;
    It's extremely useful for testing/debugging - have fun!&lt;br /&gt;
    &lt;br /&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;div style="background-color: #cccccc; padding: 5px;"&gt;Don't forget to &lt;b&gt;UNDO the iPhone settings&lt;/b&gt; when you're finished!!&lt;/div&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;
 &lt;img src="http://geekswithblogs.net/wojan/aggbug/152961.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2013/05/20/152961.aspx</guid>
            <pubDate>Mon, 20 May 2013 14:26:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/152961.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2013/05/20/152961.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/152961.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/152961.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET MVC Helper Method for Enums... supports override of text using System.ComponentModel.DescriptionAttribute</title>
            <link>http://geekswithblogs.net/wojan/archive/2013/03/13/152396.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2013/03/13/152396.aspx'&gt;http://geekswithblogs.net/wojan/archive/2013/03/13/152396.aspx&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size:&amp;#xD;&amp;#xA;9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;public&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;static&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:#2B91AF;background:white;mso-highlight:white"&gt;MvcHtmlString&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; DropDownListFromEnumFor&amp;lt;TModel, TProperty&amp;gt;(&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;this&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;HtmlHelper&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;lt;TModel&amp;gt;
helper, &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;&amp;#xD;&amp;#xA;background:white;mso-highlight:white"&gt;Expression&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;Func&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;lt;TModel, TProperty&amp;gt;&amp;gt;
expression, &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;object&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; htmlAttribute = &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;null&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;var&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; type = &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;typeof&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; (TProperty);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;var&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; addBlank = &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;false&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;if&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; (type.IsGenericType &amp;amp;&amp;amp;
type.GetGenericTypeDefinition() == &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;typeof&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;(&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:#2B91AF;background:white;mso-highlight:white"&gt;Nullable&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;lt;&amp;gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;        type = type.GetGenericArguments()[0];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;        addBlank = &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;true&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;var&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; values = (&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;from&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; f &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;in&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; type.GetFields(System.Reflection.&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;BindingFlags&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;.Public
| System.Reflection.&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:#2B91AF;background:white;mso-highlight:white"&gt;BindingFlags&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;.Static)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;                                    &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;let&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; attribute =
f.GetCustomAttributes(&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;typeof&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;(System.ComponentModel.&lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white"&gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;), &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;true&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;).FirstOrDefault() &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;as&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; System.ComponentModel.&lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white"&gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;                                    &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;select&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;new&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;                                    {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;                                        Text =
attribute == &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;null&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; ? f.Name : attribute.Description,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;                                        Value =
f.Name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;                                   
}).ToList();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;if&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; (addBlank)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;        values.Insert(0, &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;new&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; {Text = &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;String&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;.Empty, Value = &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;String&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;.Empty});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;return&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; helper.DropDownListFor(expression,&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;new&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;SelectList&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;(values, &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;"Value"&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;, &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;"Text"&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;),
htmlAttribute);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; line-height: 115%; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Will take…&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size:&amp;#xD;&amp;#xA;9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;public&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;enum&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:#2B91AF;background:white;mso-highlight:white"&gt;Salutation&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    [&lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white"&gt;Description&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;(&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:#A31515;background:white;mso-highlight:white"&gt;"Mr."&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    Mr = 100,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    [&lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white"&gt;Description&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;(&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:#A31515;background:white;mso-highlight:white"&gt;"Mr."&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    Ms = 101,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    [&lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white"&gt;Description&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;(&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:#A31515;background:white;mso-highlight:white"&gt;"Mrs."&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    Mrs = 102,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    [&lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white"&gt;Description&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;(&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:#A31515;background:white;mso-highlight:white"&gt;"Miss"&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;    Miss = 103&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; line-height: 115%; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;And convert it to…&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size:&amp;#xD;&amp;#xA;9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;select&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;id&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Suffix"&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:red;background:white;mso-highlight:white"&gt;name&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;="Suffix"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Junior"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Junior&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Senior"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Senior&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="First"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;First&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Second"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Second&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Third"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Third&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Fourth"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Fourth&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Fifth"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Fifth&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size:9.5pt;line-height:115%;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;line-height:115%;font-family:Consolas;color:maroon;&amp;#xD;&amp;#xA;background:white;mso-highlight:white"&gt;select&lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;line-height:115%;font-family:Consolas;color:blue;background:white;mso-highlight:&amp;#xD;&amp;#xA;white"&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Or if it’s a nullable property…&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size:&amp;#xD;&amp;#xA;9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;select&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;id&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Suffix"&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:red;background:white;mso-highlight:white"&gt;name&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;="Suffix"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:yellow;mso-highlight:yellow"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:yellow;&amp;#xD;&amp;#xA;mso-highlight:yellow"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: yellow; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:yellow;&amp;#xD;&amp;#xA;mso-highlight:yellow"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:yellow;mso-highlight:yellow"&gt;=""&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:yellow;&amp;#xD;&amp;#xA;mso-highlight:yellow"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:yellow;mso-highlight:yellow"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Junior"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Junior&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Senior"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Senior&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="First"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;First&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Second"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Second&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Third"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Third&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Fourth"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Fourth&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;  &lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:red;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;value&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;="Fifth"&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;Fifth&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;&amp;#xD;&amp;#xA;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:maroon;background:white;&amp;#xD;&amp;#xA;mso-highlight:white"&gt;option&lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size:9.5pt;line-height:115%;font-family:&amp;#xD;&amp;#xA;Consolas;color:blue;background:white;mso-highlight:white"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:9.5pt;line-height:115%;font-family:Consolas;color:maroon;&amp;#xD;&amp;#xA;background:white;mso-highlight:white"&gt;select&lt;/span&gt;&lt;span style="font-size:9.5pt;&amp;#xD;&amp;#xA;line-height:115%;font-family:Consolas;color:blue;background:white;mso-highlight:&amp;#xD;&amp;#xA;white"&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/152396.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2013/03/13/152396.aspx</guid>
            <pubDate>Wed, 13 Mar 2013 22:07:28 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/152396.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2013/03/13/152396.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/152396.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/152396.aspx</trackback:ping>
        </item>
        <item>
            <title>Enum helper for values specified in attributes</title>
            <link>http://geekswithblogs.net/wojan/archive/2012/05/17/149675.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2012/05/17/149675.aspx'&gt;http://geekswithblogs.net/wojan/archive/2012/05/17/149675.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I've used this enum helper from time to time to get an enum value from attributes such as Description and XmlEnumAttribute.  Maybe you can find it useful? &lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;    &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: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;EnumEx&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 style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T
GetXmlEnumValue&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt; name)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; type = CheckEnum&amp;lt;T&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; val = (&lt;span style="color: blue;"&gt;from&lt;/span&gt; f &lt;span style="color: blue;"&gt;in&lt;/span&gt; type.GetFields()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;         &lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;let&lt;/span&gt;
attribute = f.GetCustomAttributes(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(System.Xml.Serialization.&lt;span style="color: rgb(43, 145, 175);"&gt;XmlEnumAttribute&lt;/span&gt;), &lt;span style="color: blue;"&gt;true&lt;/span&gt;).FirstOrDefault()
&lt;span style="color: blue;"&gt;as&lt;/span&gt; System.Xml.Serialization.&lt;span style="color: rgb(43, 145, 175);"&gt;XmlEnumAttribute&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;                       &lt;/span&gt;&lt;span style="color: blue;"&gt;where&lt;/span&gt;
attribute != &lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;                          &lt;/span&gt;&amp;amp;&amp;amp; attribute.Name
== name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;                       &lt;/span&gt;&lt;span style="color: blue;"&gt;select&lt;/span&gt;
(T)f.GetValue(&lt;span style="color: blue;"&gt;null&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (val.Count() == 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;               
&lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt;
&lt;span style="color: rgb(43, 145, 175);"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: rgb(163, 21, 21);"&gt;"&lt;/span&gt;&lt;span style="color: mediumseagreen;"&gt;{0}&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt; is not a valid XmlEnumAttribute for &lt;/span&gt;&lt;span style="color: mediumseagreen;"&gt;{1}&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"&lt;/span&gt;,
name, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T).FullName), &lt;span style="color: rgb(163, 21, 21);"&gt;"name"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; val.First();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T
GetValueFromDescription&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt;
description)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; type = CheckEnum&amp;lt;T&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; val = (&lt;span style="color: blue;"&gt;from&lt;/span&gt; f &lt;span style="color: blue;"&gt;in&lt;/span&gt; type.GetFields()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;                       &lt;/span&gt;&lt;span style="color: blue;"&gt;let&lt;/span&gt;
attribute = f.GetCustomAttributes(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(System.ComponentModel.&lt;span style="color: rgb(43, 145, 175);"&gt;DescriptionAttribute&lt;/span&gt;), &lt;span style="color: blue;"&gt;true&lt;/span&gt;).FirstOrDefault()
&lt;span style="color: blue;"&gt;as&lt;/span&gt; System.ComponentModel.&lt;span style="color: rgb(43, 145, 175);"&gt;DescriptionAttribute&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;                       &lt;/span&gt;where attribute != &lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;                          &lt;/span&gt;&amp;amp;&amp;amp;
attribute.Description == description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;                       &lt;/span&gt;select (T)f.GetValue(&lt;span style="color: blue;"&gt;null&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (val.Count() == 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;               
&lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt;
&lt;span style="color: rgb(43, 145, 175);"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: rgb(163, 21, 21);"&gt;"&lt;/span&gt;&lt;span style="color: mediumseagreen;"&gt;{0}&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt; is not a valid description for &lt;/span&gt;&lt;span style="color: mediumseagreen;"&gt;{1}&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"&lt;/span&gt;,
description, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T).FullName), &lt;span style="color: rgb(163, 21, 21);"&gt;"description"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; val.First();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Type&lt;/span&gt; CheckEnum&amp;lt;T&amp;gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; type = &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (type.IsEnum == &lt;span style="color: blue;"&gt;false&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;               
&lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt;
&lt;span style="color: rgb(43, 145, 175);"&gt;InvalidOperationException&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: rgb(163, 21, 21);"&gt;"&lt;/span&gt;&lt;span style="color: mediumseagreen;"&gt;{0}&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt; is not an
enum"&lt;/span&gt;, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; type;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;o:p&gt;&lt;font face="Calibri"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;

 &lt;img src="http://geekswithblogs.net/wojan/aggbug/149675.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2012/05/17/149675.aspx</guid>
            <pubDate>Thu, 17 May 2012 21:06:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/149675.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2012/05/17/149675.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/149675.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/149675.aspx</trackback:ping>
        </item>
        <item>
            <title>Extension Methods for ToXml and FromXml</title>
            <link>http://geekswithblogs.net/wojan/archive/2011/05/18/145422.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2011/05/18/145422.aspx'&gt;http://geekswithblogs.net/wojan/archive/2011/05/18/145422.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;So I've found these to be useful on a couple of projects, hopefully you will also&lt;/p&gt;
&lt;div style="border: 1px solid rgb(0, 0, 128); color: rgb(0, 0, 0); font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 10pt;"&gt;
&lt;div style="background: rgb(255, 255, 255); overflow: auto;"&gt;
&lt;ol style="background: rgb(255, 255, 255); margin: 0px; padding: 0px 0px 0px 5px;"&gt;
    &lt;li&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; System;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/li&gt;
    &lt;li&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; System.IO;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; System.Text;&lt;/li&gt;
    &lt;li&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; System.Xml;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; System.Xml.Serialization;&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlExtensionMethods&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;{&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;readonly&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;Type&lt;/span&gt;, &lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializer&lt;/span&gt;&amp;gt; Serializers;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; XmlExtensionMethods()&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    {&lt;/li&gt;
    &lt;li&gt;        Serializers = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;Type&lt;/span&gt;, &lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializer&lt;/span&gt;&amp;gt;();&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    }&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializer&lt;/span&gt; GetSerializer(&lt;span style="color: rgb(43, 145, 175);"&gt;Type&lt;/span&gt; type)&lt;/li&gt;
    &lt;li&gt;    {&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(0, 128, 0);"&gt;//If it exists, return it&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; ((Serializers.ContainsKey(type)))&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        {&lt;/li&gt;
    &lt;li&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; Serializers[type];&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        }&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(0, 128, 0);"&gt;//If not, create it, add it to the list and return it.&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; xmlSerializer = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializer&lt;/span&gt;(type);&lt;/li&gt;
    &lt;li&gt;        Serializers.Add(type, xmlSerializer);&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; xmlSerializer;&lt;/li&gt;
    &lt;li&gt;    }&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt; &lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Serializes the object to XML using the given xml writer settings.&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;param name="obj"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;param name="xmlWriterSettings"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; ToXml&amp;lt;T&amp;gt;(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt; T obj, &lt;span style="color: rgb(43, 145, 175);"&gt;XmlWriterSettings&lt;/span&gt; xmlWriterSettings)&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    {&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (Equals(obj, &lt;span style="color: rgb(0, 0, 255);"&gt;default&lt;/span&gt;(T)))&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        {&lt;/li&gt;
    &lt;li&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;String&lt;/span&gt;.Empty;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        }&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; memoryStream = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;MemoryStream&lt;/span&gt;())&lt;/li&gt;
    &lt;li&gt;        {&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; xmlSerializer = GetSerializer(obj.GetType());&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            &lt;span style="color: rgb(0, 128, 0);"&gt;//Remove the xmlns attribute.&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; xmlnsEmpty = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializerNamespaces&lt;/span&gt;();&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            xmlnsEmpty.Add(&lt;span style="color: rgb(43, 145, 175);"&gt;String&lt;/span&gt;.Empty, &lt;span style="color: rgb(43, 145, 175);"&gt;String&lt;/span&gt;.Empty);&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; xmlTextWriter = &lt;span style="color: rgb(43, 145, 175);"&gt;XmlWriter&lt;/span&gt;.Create(memoryStream, xmlWriterSettings))&lt;/li&gt;
    &lt;li&gt;            {&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;                xmlSerializer.Serialize(xmlTextWriter, obj, xmlnsEmpty);&lt;/li&gt;
    &lt;li&gt;                memoryStream.Seek(0, &lt;span style="color: rgb(43, 145, 175);"&gt;SeekOrigin&lt;/span&gt;.Begin); &lt;span style="color: rgb(0, 128, 0);"&gt;//Rewind the Stream.&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            }&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; xml = xmlWriterSettings.Encoding.GetString(memoryStream.ToArray());&lt;/li&gt;
    &lt;li&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; xml;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        }&lt;/li&gt;
    &lt;li&gt;    }&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt; &lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Serializes the object to XML, with or without the declaration.&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;param name="obj"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;param name="omitXmlDeclaration"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Gets or sets a value indicating whether to write an XML declaration.&lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; ToXml&amp;lt;T&amp;gt;(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt; T obj, &lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt; omitXmlDeclaration)&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    {&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; obj.ToXml(&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlWriterSettings&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        {&lt;/li&gt;
    &lt;li&gt;            Encoding = &lt;span style="color: rgb(43, 145, 175);"&gt;Encoding&lt;/span&gt;.UTF8,&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            OmitXmlDeclaration = omitXmlDeclaration&lt;/li&gt;
    &lt;li&gt;        });&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    }&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Serializes the object to XML&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;param name="obj"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; ToXml&amp;lt;T&amp;gt;(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt; T obj)&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    {&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; obj.ToXml(&lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;);&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    }&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Deserializes the object from xml.&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;typeparam name="T"&amp;gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;param name="xml"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; T FromXml&amp;lt;T&amp;gt;(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; xml)&lt;/li&gt;
    &lt;li&gt;    {&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; s = GetSerializer(&lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt;(T));&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; settings = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlReaderSettings&lt;/span&gt; { ConformanceLevel = &lt;span style="color: rgb(43, 145, 175);"&gt;ConformanceLevel&lt;/span&gt;.Auto };&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; stringReader = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;StringReader&lt;/span&gt;(xml))&lt;/li&gt;
    &lt;li&gt;        {&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; xmlReader = &lt;span style="color: rgb(43, 145, 175);"&gt;XmlReader&lt;/span&gt;.Create(stringReader, settings))&lt;/li&gt;
    &lt;li&gt;            {&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; obj = s.Deserialize(xmlReader);&lt;/li&gt;
    &lt;li&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; (T)obj;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;            }&lt;/li&gt;
    &lt;li&gt;        }&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    }&lt;/li&gt;
    &lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The following code...&lt;/p&gt;
&lt;div style="border: 1px solid rgb(0, 0, 128); color: rgb(0, 0, 0); font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 10pt;"&gt;
&lt;div style="background: rgb(255, 255, 255); overflow: auto;"&gt;
&lt;ol style="background: rgb(255, 255, 255); margin: 0px; padding: 0px 0px 0px 5px;"&gt;
    &lt;li&gt;[&lt;span style="color: rgb(43, 145, 175);"&gt;Serializable&lt;/span&gt;]&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;TestClass&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;{&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;? DateSent { &lt;span style="color: rgb(0, 0, 255);"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(0, 0, 255);"&gt;set&lt;/span&gt;; }&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; SomeTextValue { &lt;span style="color: rgb(0, 0, 255);"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(0, 0, 255);"&gt;set&lt;/span&gt;; }&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;decimal&lt;/span&gt; SomeDecimalValue { &lt;span style="color: rgb(0, 0, 255);"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(0, 0, 255);"&gt;set&lt;/span&gt;; }&lt;/li&gt;
    &lt;li&gt;}&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt; &lt;/li&gt;
    &lt;li&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Program&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;{&lt;/li&gt;
    &lt;li&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; Main(&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt;[] args)&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;    {&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; testClass = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;TestClass&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;                            {&lt;/li&gt;
    &lt;li&gt;                                DateSent = &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;.Now,&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;                                SomeDecimalValue = 22.33m,&lt;/li&gt;
    &lt;li&gt;                                SomeTextValue = &lt;span style="color: rgb(163, 21, 21);"&gt;"This is a test"&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;                            };&lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(testClass.ToXml());&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(testClass.ToXml(&lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;));&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; xml = testClass.ToXml(&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlWriterSettings&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;                                         {&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;                                             Indent = &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,&lt;/li&gt;
    &lt;li&gt;                                             Encoding = &lt;span style="color: rgb(43, 145, 175);"&gt;Encoding&lt;/span&gt;.ASCII&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;                                         });&lt;/li&gt;
    &lt;li&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(xml);&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt; &lt;/li&gt;
    &lt;li&gt; &lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.ReadKey();&lt;/li&gt;
    &lt;li&gt;    }&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Would produce:&lt;/p&gt;
&lt;div style="border: 1px solid rgb(0, 0, 128); color: rgb(0, 0, 0); font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 10pt;"&gt;
&lt;div style="background: rgb(255, 255, 255); overflow: auto;"&gt;
&lt;ol style="background: rgb(255, 255, 255); margin: 0px; padding: 0px 0px 0px 5px;"&gt;
    &lt;li&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;xml&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;version&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;1.0&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;encoding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;utf-8&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;?&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TestClass&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DateSent&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;2011-05-18T08:32:37.9236147-05:00&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DateSent&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeTextValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;This is a test&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeTextValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeDecimalValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;22.33&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeDecimalValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TestClass&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt; &lt;/li&gt;
    &lt;li&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TestClass&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DateSent&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;2011-05-18T08:32:37.9236147-05:00&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DateSent&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeTextValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;This is a test&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeTextValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeDecimalValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;22.33&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeDecimalValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TestClass&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt; &lt;/li&gt;
    &lt;li&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;xml&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;version&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;1.0&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;encoding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;us-ascii&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;?&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TestClass&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DateSent&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;2011-05-18T08:34:41.8800091-05:00&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DateSent&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeTextValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;This is a test&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeTextValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeDecimalValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;22.33&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SomeDecimalValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style="background: rgb(243, 243, 243);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TestClass&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/145422.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2011/05/18/145422.aspx</guid>
            <pubDate>Wed, 18 May 2011 16:47:38 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/145422.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2011/05/18/145422.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/145422.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/145422.aspx</trackback:ping>
        </item>
        <item>
            <title>An open plea to Microsoft to fix the serializers in WCF.</title>
            <category>Rants</category>
            <link>http://geekswithblogs.net/wojan/archive/2010/12/10/143086.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2010/12/10/143086.aspx'&gt;http://geekswithblogs.net/wojan/archive/2010/12/10/143086.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I simply DO NOT understand how Microsoft can be this far along with a tool like WCF and it STILL tout it as being an "Enterprise" tool.&lt;/p&gt;
&lt;p&gt;For example... The following is a simple xsd schema with a VERY simple data contract that any enterprise would expect an "enterprise system" to be able to handle:&lt;/p&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xml &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;version&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;1.0&lt;/span&gt;" &lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;"&lt;span style="color: blue"&gt;utf-8&lt;/span&gt;"&lt;span style="color: blue"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:schema &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;id&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;Sample&lt;/span&gt;"&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;targetNamespace&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;http://tempuri.org/Sample.xsd&lt;/span&gt;"&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;elementFormDefault&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;qualified&lt;/span&gt;"&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;http://tempuri.org/Sample.xsd&lt;/span&gt;"&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;xmlns:mstns&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;http://tempuri.org/Sample.xsd&lt;/span&gt;"&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;xmlns:xs&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;http://www.w3.org/2001/XMLSchema&lt;/span&gt;"&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt; &lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:element &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;name&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;SomeDataElement&lt;/span&gt;"&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:annotation&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:documentation&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;This documents the data element. This sure would be nice for consumers to see!&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:documentation&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:annotation&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:all&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:element &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;name&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;Description&lt;/span&gt;" &lt;span style="color: red"&gt;minOccurs&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;"&lt;span style="color: blue"&gt;0&lt;/span&gt;"&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:simpleType&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:restriction &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;base&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;xs:string&lt;/span&gt;"&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;              &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:minLength &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;value&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;0&lt;/span&gt;"&lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;              &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:maxLength &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;value&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;255&lt;/span&gt;"&lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:restriction&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;          &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:simpleType&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:element&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:all&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:attribute &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;name&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;IPAddress&lt;/span&gt;" &lt;span style="color: red"&gt;use&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;"&lt;span style="color: blue"&gt;required&lt;/span&gt;"&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:annotation&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:documentation&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;Another explanation!  WOW!&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:documentation&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:annotation&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:simpleType&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:restriction &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;base&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;xs:string&lt;/span&gt;"&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:pattern &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;value&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;(([1-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([1-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])&lt;/span&gt;"&lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;          &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:restriction&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:simpleType&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:attribute&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:element&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:schema&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt; &lt;/div&gt;
&lt;p&gt;An minimal example xml document would be:&lt;/p&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xml &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;version&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;1.0&lt;/span&gt;"&lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;"&lt;span style="color: blue"&gt;utf-8&lt;/span&gt;"&lt;span style="color: blue"&gt; ?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;SomeDataElement&lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;http://tempuri.org/Sample.xsd&lt;/span&gt;" &lt;span style="color: red"&gt;IPAddress&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;"&lt;span style="color: blue"&gt;1.1.168.10&lt;/span&gt;"&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;SomeDataElement&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;With the max example being: &lt;/p&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xml &lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;version&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;1.0&lt;/span&gt;"&lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;"&lt;span style="color: blue"&gt;utf-8&lt;/span&gt;"&lt;span style="color: blue"&gt; ?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;SomeDataElement&lt;/span&gt;&lt;span style="color: red; font-size: 9.5pt"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;=&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;"&lt;span style="color: blue"&gt;http://tempuri.org/Sample.xsd&lt;/span&gt;" &lt;span style="color: red"&gt;IPAddress&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;"&lt;span style="color: blue"&gt;1.1.168.10&lt;/span&gt;"&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;Description&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;ddd&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Description&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;SomeDataElement&lt;/span&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;This schema simply CANNOT be exposed by WCF. &lt;/p&gt;
&lt;p&gt;Let's list why: &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;svcutil.exe will not generate classes for you because it can't read an xsd with &lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:annotation&lt;/span&gt;.&lt;/li&gt;
    &lt;li&gt;Even if you remove the documentation, the DataContractSerializer DOES NOT support attributes so IPAddress would become an element this not meeting the contract&lt;/li&gt;
    &lt;li&gt;xsd.exe could generate classes but it is a very legacy tool, generates legacy code, and you still suffer from the following issues:&lt;/li&gt;
    &lt;li&gt;NONE of the serializers support emitting of the &lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:annotation&lt;/span&gt; documentation.  You'd think a consumer would really like to have as much documentation as possible!&lt;/li&gt;
    &lt;li&gt;NONE of the serializers support the enforcement of &lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:restriction&lt;/span&gt; so you can forget about the &lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:&lt;/span&gt;&lt;font color="#a31515" size="2"&gt;minLength&lt;/font&gt;, &lt;font color="#a31515" size="2"&gt;&lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:&lt;/span&gt;maxLength&lt;/font&gt;, or &lt;span style="color: #a31515; font-size: 9.5pt"&gt;xs:pattern&lt;/span&gt; enforcement.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Microsoft... please, please, please, please look at putting the work into your serializers so that they support &lt;u&gt;the very basics &lt;/u&gt;of designing enterprise data contracts!!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/143086.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2010/12/10/143086.aspx</guid>
            <pubDate>Fri, 10 Dec 2010 18:40:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/143086.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2010/12/10/143086.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/143086.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/143086.aspx</trackback:ping>
        </item>
        <item>
            <title>Multithreaded queue with exception handling and progress reporting</title>
            <link>http://geekswithblogs.net/wojan/archive/2010/09/08/141682.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2010/09/08/141682.aspx'&gt;http://geekswithblogs.net/wojan/archive/2010/09/08/141682.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="margin: 0in 0in 0pt 0.25in;"&gt;Below is a multithreaded queue with progress reporting and nice exception handling that I implemented for a project. I hope it might help someone else. You can copy and paste the following code into a console app to see how to use it.&lt;/div&gt;
&lt;div style="margin: 0in 0in 0pt 0.25in;"&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-size: 9.5pt;"&gt; System;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-size: 9.5pt;"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-size: 9.5pt;"&gt; System.ComponentModel;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-size: 9.5pt;"&gt; System.Diagnostics;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-size: 9.5pt;"&gt; System.Threading;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 9.5pt;"&gt; WorkQueueTest&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Program&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; locker = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: green;"&gt;//You can play with these values to test&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;var&lt;/span&gt; workQueueSettings = &lt;span style="color: blue;"&gt;new&lt;/span&gt; {NumberOfTasks = 6, NumberOfTaskSteps = 3, TaskStepSleepTime = 500, NumberOfThreads = 3};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;var&lt;/span&gt; nonThreadingTime = workQueueSettings.NumberOfTasks * workQueueSettings.NumberOfTaskSteps * workQueueSettings.TaskStepSleepTime;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"====================\nWithout a work queue, this would take {0} milliseconds\n===================="&lt;/span&gt;, nonThreadingTime);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;var&lt;/span&gt; workQueue = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;WorkQueue&lt;/span&gt;(workQueueSettings.NumberOfThreads);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;var&lt;/span&gt; stopWatch = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Stopwatch&lt;/span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            stopWatch.Start();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &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; workQueueSettings.NumberOfTasks; i++)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: blue;"&gt;var&lt;/span&gt; index = i;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                workQueue.Enqueue(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;WorkItem&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                      {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                          OnException = OnException,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                          OnProgressChanged = OnProgressChanged,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                          Task = onProgressChangedCallBack =&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                          {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt;"&gt;                                              #region&lt;/span&gt;&lt;span style="font-size: 9.5pt;"&gt; - Code to actually do stuff goes here... the rest of this is sample fluff&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              &lt;span style="color: green;"&gt;//&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              &lt;span style="color: blue;"&gt;var&lt;/span&gt; taskName = &lt;span style="color: rgb(163, 21, 21);"&gt;"Task #"&lt;/span&gt; + index;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              &lt;span style="color: green;"&gt;//fake some long running process&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;var&lt;/span&gt; j = 0; j &amp;lt; workQueueSettings.NumberOfTaskSteps; j++)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                                  &lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;.Sleep(workQueueSettings.TaskStepSleepTime);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                                  &lt;span style="color: blue;"&gt;var&lt;/span&gt; percent = (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)(((&lt;span style="color: blue;"&gt;decimal&lt;/span&gt;)j / workQueueSettings.NumberOfTaskSteps) * 100);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                                  onProgressChangedCallBack(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ProgressChangedEventArgs&lt;/span&gt;(percent, taskName));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              &lt;span style="color: blue;"&gt;if&lt;/span&gt; (workQueueSettings.NumberOfTasks&amp;gt;2 &amp;amp;&amp;amp; index == 2)&lt;span style="color: green;"&gt;//fake a sample exception&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                                  &lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Exception&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"Some fake exception."&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              onProgressChangedCallBack(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ProgressChangedEventArgs&lt;/span&gt;(100, taskName));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt;"&gt;                                              #endregion&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                          }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                              &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                                      });&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            workQueue.WaitForTasksToComplete();&lt;span style="color: green;"&gt;//wait for the tasks to complete before continuing&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            workQueue.Stop(&lt;span style="color: blue;"&gt;false&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            stopWatch.Stop();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"====================\nTotal time = {0} milliseconds\n====================\nPress any key to exit"&lt;/span&gt;, stopWatch.ElapsedMilliseconds);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.ReadLine();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; OnException(&lt;span style="color: rgb(43, 145, 175);"&gt;Exception&lt;/span&gt; ex)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;lock&lt;/span&gt; (locker)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.ForegroundColor = &lt;span style="color: rgb(43, 145, 175);"&gt;ConsoleColor&lt;/span&gt;.Red;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"EXCEPTION: {0}"&lt;/span&gt;, ex);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.ResetColor();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; OnProgressChanged(&lt;span style="color: rgb(43, 145, 175);"&gt;ProgressChangedEventArgs&lt;/span&gt; eventArgs)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;lock&lt;/span&gt; (locker)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: blue;"&gt;switch&lt;/span&gt; (eventArgs.ProgressPercentage)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    &lt;span style="color: blue;"&gt;case&lt;/span&gt; 0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.ForegroundColor = &lt;span style="color: rgb(43, 145, 175);"&gt;ConsoleColor&lt;/span&gt;.Yellow;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Starting {0}"&lt;/span&gt;, eventArgs.UserState);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    &lt;span style="color: blue;"&gt;case&lt;/span&gt; 100:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.ForegroundColor = &lt;span style="color: rgb(43, 145, 175);"&gt;ConsoleColor&lt;/span&gt;.Green;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Completed 100% of {0}"&lt;/span&gt;, eventArgs.UserState);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    &lt;span style="color: blue;"&gt;default&lt;/span&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Completed {0} of {1}"&lt;/span&gt;, eventArgs.ProgressPercentage, eventArgs.UserState);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.ResetColor();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;WorkItem&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;virtual&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;Exception&lt;/span&gt;&amp;gt; OnException { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;virtual&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;ProgressChangedEventArgs&lt;/span&gt;&amp;gt; OnProgressChanged { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;virtual&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;ProgressChangedEventArgs&lt;/span&gt;&amp;gt;&amp;gt; Task { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;WorkQueue&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; locker = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;[] threads;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Queue&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;WorkItem&lt;/span&gt;&amp;gt; queue = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Queue&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;WorkItem&lt;/span&gt;&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;internal&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;QueueStopWorkItem&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;WorkItem&lt;/span&gt;{}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; WorkQueue(&lt;span style="color: blue;"&gt;int&lt;/span&gt; workerCount)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            threads = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt; [workerCount];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: green;"&gt;// Create and start a separate thread for each worker&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &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; workerCount; i++)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                (threads [i] = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt; (RunWorkItem)).Start();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Stop (&lt;span style="color: blue;"&gt;bool&lt;/span&gt; waitForWorkersToComplete)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;if&lt;/span&gt; (waitForWorkersToComplete == &lt;span style="color: blue;"&gt;false&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: blue;"&gt;lock&lt;/span&gt; (locker)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    queue.Clear();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: green;"&gt;// Enqueue stop worker item for each worker to make each exit.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &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; threads.Length; i++)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                Enqueue(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;QueueStopWorkItem&lt;/span&gt;());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: green;"&gt;// Wait for threads to finish&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;if&lt;/span&gt; (waitForWorkersToComplete)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &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; threads.Length; i++)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    threads[i].Join();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Enqueue (&lt;span style="color: rgb(43, 145, 175);"&gt;WorkItem&lt;/span&gt; workItem)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;lock&lt;/span&gt; (locker)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                queue.Enqueue(workItem); &lt;span style="color: green;"&gt;//Push one element into the queue.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: rgb(43, 145, 175);"&gt;Monitor&lt;/span&gt;.Pulse(locker);   &lt;span style="color: green;"&gt;//Release the waiting thread&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;void&lt;/span&gt; RunWorkItem()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            &lt;span style="color: blue;"&gt;while&lt;/span&gt; (&lt;span style="color: blue;"&gt;true&lt;/span&gt;)&lt;span style="color: green;"&gt;// loop until a stop work item is found.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: rgb(43, 145, 175);"&gt;WorkItem&lt;/span&gt; item;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: blue;"&gt;lock&lt;/span&gt; (locker)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    &lt;span style="color: blue;"&gt;while&lt;/span&gt; (queue.Count == 0)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: rgb(43, 145, 175);"&gt;Monitor&lt;/span&gt;.Wait(locker); &lt;span style="color: green;"&gt;////Wait, if the queue is busy.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    item = queue.Dequeue();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: blue;"&gt;if&lt;/span&gt; (item &lt;span style="color: blue;"&gt;is&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;QueueStopWorkItem&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    &lt;span style="color: blue;"&gt;return&lt;/span&gt;; &lt;span style="color: green;"&gt;// Time to exit.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    item.Task(item.OnProgressChanged); &lt;span style="color: green;"&gt;// Execute item.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                &lt;span style="color: blue;"&gt;catch&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Exception&lt;/span&gt; ex)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    &lt;span style="color: blue;"&gt;if&lt;/span&gt; (item.OnException != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        item.OnException(ex);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                    &lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                        &lt;span style="color: blue;"&gt;throw&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;                }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; WaitForTasksToComplete()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;            Stop(&lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div style="margin: 0in 0in 0pt 0.25in;"&gt; &lt;/div&gt;
&lt;div style="margin: 0in 0in 0pt 0.25in;"&gt; &lt;/div&gt;
&lt;div style="margin: 0in 0in 0pt 0.25in;"&gt;The result should look like the following:&lt;/div&gt;
&lt;div style="margin: 0in 0in 0pt 0.25in;"&gt; &lt;/div&gt;
&lt;div style="margin: 0in 0in 0pt 0.25in;"&gt; &lt;img src="http://gwb.blob.core.windows.net/wojan/10492/r_Untitled.png" alt="" /&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/141682.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2010/09/08/141682.aspx</guid>
            <pubDate>Wed, 08 Sep 2010 16:46:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/141682.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2010/09/08/141682.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/141682.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/141682.aspx</trackback:ping>
        </item>
        <item>
            <title>SimpleWcf - WCF 4.0 made easy</title>
            <link>http://geekswithblogs.net/wojan/archive/2010/08/13/simplewcf.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2010/08/13/simplewcf.aspx'&gt;http://geekswithblogs.net/wojan/archive/2010/08/13/simplewcf.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I just released a new project on CodePlex called SimpleWcf"&lt;/p&gt;
&lt;p&gt;SimpleWcf provides a way to essentially do “simple, configuration-less, file-less, WCF 4.0”. It works by discovering services using reflection and assumes a convention is intended for the namespaces. &lt;/p&gt;
&lt;p&gt;It leverages a lot of the great new baked in defaults in WCF 4.0.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://simplewcf.codeplex.com/documentation"&gt;http://simplewcf.codeplex.com/documentation&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/141299.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2010/08/13/simplewcf.aspx</guid>
            <pubDate>Fri, 13 Aug 2010 15:18:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/141299.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2010/08/13/simplewcf.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/141299.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/141299.aspx</trackback:ping>
        </item>
        <item>
            <title>Loading symbols in Visual Studio 2008 Slow</title>
            <link>http://geekswithblogs.net/wojan/archive/2010/04/01/139042.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2010/04/01/139042.aspx'&gt;http://geekswithblogs.net/wojan/archive/2010/04/01/139042.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I was fighting with this issue today... Visual Studio was taking FOREVER to load the symbol files (.pdb) in order to start debugging.  It seems if you clear all of your break points, the issue is corrected.  Hope this helps someone.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/139042.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2010/04/01/139042.aspx</guid>
            <pubDate>Thu, 01 Apr 2010 20:32:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/139042.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2010/04/01/139042.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/139042.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/139042.aspx</trackback:ping>
        </item>
        <item>
            <title>Is it cold in here?</title>
            <link>http://geekswithblogs.net/wojan/archive/2009/08/19/134195.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2009/08/19/134195.aspx'&gt;http://geekswithblogs.net/wojan/archive/2009/08/19/134195.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Wow, so I just had to install the JRE for a product and was shocked to see the following:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Java... now with Bing?" src="http://gwb.blob.core.windows.net/wojan/10492/r_bing.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;AND they recommend it! &lt;/p&gt;
&lt;p&gt;Hell hath frozen!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/134195.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2009/08/19/134195.aspx</guid>
            <pubDate>Wed, 19 Aug 2009 18:01:56 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/134195.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2009/08/19/134195.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/134195.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/134195.aspx</trackback:ping>
        </item>
        <item>
            <title>JQuery LightBox Max Height and Width</title>
            <link>http://geekswithblogs.net/wojan/archive/2009/06/17/jquerylightbox.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2009/06/17/jquerylightbox.aspx'&gt;http://geekswithblogs.net/wojan/archive/2009/06/17/jquerylightbox.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I needed &lt;a target="_blank" href="http://www.huddletogether.com/projects/lightbox2/#download"&gt;lightbox 2&lt;/a&gt; functionality for a project I'm working on, but didn't want the overhead of having to include prototype, scriptaculous, et al that comes with it since we are already using JQuery.  I found the excellent &lt;a target="_blank" href="http://leandrovieira.com/projects/jquery/lightbox/"&gt;JQuery lightbox plugin&lt;/a&gt; written by &lt;font face=""&gt;Leandro Vieira Pinho and works well, but I needed to be able to set the max height and width so I had to mod the code as follows:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;settings = jQuery.extend({
    maxWidth: null,
    maxHeight: null,

...

function _resize_container_image_box(intImageWidth,intImageHeight) {
    //rescale if necessary
    if((settings.maxWidth != null &amp;amp;&amp;amp; settings.maxHeight != null) &amp;amp;&amp;amp; (intImageWidth &amp;gt; settings.maxWidth || intImageHeight &amp;gt; settings.maxHeight)){
	var isWider = intImageWidth &amp;gt; intImageHeight;//is the image wide or tall?
	var scale = isWider ?  settings.maxWidth/intImageWidth : settings.maxHeight/intImageHeight;
	intImageWidth = intImageWidth * scale;
	intImageHeight = intImageHeight * scale;
     }

     $('#lightbox-image').height(intImageHeight); 
     $('#lightbox-image').width(intImageWidth);  

...
&lt;/pre&gt;
Now you can specify a max width and height like:&lt;br /&gt;
&lt;pre&gt;    $('.yourClass a').lightBox({
            maxHeight: 500,
            maxWidth: 700
    });
&lt;/pre&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/132879.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2009/06/17/jquerylightbox.aspx</guid>
            <pubDate>Wed, 17 Jun 2009 14:19:54 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/132879.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2009/06/17/jquerylightbox.aspx#feedback</comments>
            <slash:comments>39</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/132879.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/132879.aspx</trackback:ping>
        </item>
        <item>
            <title>Sir... We're not the taco stand...</title>
            <link>http://geekswithblogs.net/wojan/archive/2009/05/28/132480.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2009/05/28/132480.aspx'&gt;http://geekswithblogs.net/wojan/archive/2009/05/28/132480.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;This hits home also!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;object width="853" height="505"&gt;&lt;embed height="505" type="application/x-shockwave-flash" width="853" src="http://www.youtube.com/v/R2a8TRSgzZY&amp;amp;hl=en&amp;amp;fs=1&amp;amp;color1=0x006699&amp;amp;color2=0x54abd6" allowfullscreen="true" allowscriptaccess="always"&gt;&lt;/embed&gt;&lt;/object&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/132480.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2009/05/28/132480.aspx</guid>
            <pubDate>Thu, 28 May 2009 23:35:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/132480.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2009/05/28/132480.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/132480.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/132480.aspx</trackback:ping>
        </item>
        <item>
            <title>The Downfall of Agile Hitler...</title>
            <link>http://geekswithblogs.net/wojan/archive/2009/05/09/131926.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2009/05/09/131926.aspx'&gt;http://geekswithblogs.net/wojan/archive/2009/05/09/131926.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;This had me rolling on the floor.  Hope someone else can appreciate it.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;object width="425" height="344"&gt;&lt;embed height="344" type="application/x-shockwave-flash" width="425" src="http://www.youtube.com/v/l1wKO3rID9g&amp;amp;hl=en&amp;amp;fs=1" allowfullscreen="true" allowscriptaccess="always"&gt;&lt;/embed&gt;&lt;/object&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/131926.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2009/05/09/131926.aspx</guid>
            <pubDate>Sat, 09 May 2009 15:49:33 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/131926.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2009/05/09/131926.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/131926.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/131926.aspx</trackback:ping>
        </item>
        <item>
            <title>Using PostSharp without installing via the MSI</title>
            <link>http://geekswithblogs.net/wojan/archive/2009/01/14/128673.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2009/01/14/128673.aspx'&gt;http://geekswithblogs.net/wojan/archive/2009/01/14/128673.aspx&lt;/a&gt;&lt;/p&gt;So, it took me forever today to figure out how to get &lt;a target="_blank" href="http://www.postsharp.org"&gt;PostSharp&lt;/a&gt; working without installing it 'globally' with the msi installer.&lt;br /&gt;
&lt;br /&gt;
In a nutshell, you have to include a directory for example &lt;font style="BACKGROUND-COLOR: #ffff99"&gt;/lib/ &lt;/font&gt;with all of the PostSharp baggage: &lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Default.psproj &lt;/li&gt;
    &lt;li&gt;PostSharp.targets &lt;/li&gt;
    &lt;li&gt;PostSharp-1.0.targets &lt;/li&gt;
    &lt;li&gt;PostSharp-1.0.version &lt;/li&gt;
    &lt;li&gt;PostSharp-AppDomain.config &lt;/li&gt;
    &lt;li&gt;PostSharp-Platform.config &lt;/li&gt;
    &lt;li&gt;PostSharp.Core.dll &lt;/li&gt;
    &lt;li&gt;PostSharp.Core.pdb* &lt;/li&gt;
    &lt;li&gt;PostSharp.Core.XmlSerializers.dll &lt;/li&gt;
    &lt;li&gt;PostSharp.exe &lt;/li&gt;
    &lt;li&gt;PostSharp.exe.config &lt;/li&gt;
    &lt;li&gt;PostSharp.pdb* &lt;/li&gt;
    &lt;li&gt;PostSharp.Laos.dll &lt;/li&gt;
    &lt;li&gt;PostSharp.Laos.pdb* &lt;/li&gt;
    &lt;li&gt;PostSharp.Laos.psplugin &lt;/li&gt;
    &lt;li&gt;PostSharp.Laos.Weaver.dll &lt;/li&gt;
    &lt;li&gt;PostSharp.Laos.Weaver.pdb* &lt;/li&gt;
    &lt;li&gt;PostSharp.MSBuild.dll &lt;/li&gt;
    &lt;li&gt;PostSharp.MSBuild.pdb* &lt;/li&gt;
    &lt;li&gt;PostSharp.Public.dll &lt;/li&gt;
    &lt;li&gt;PostSharp.Public.pdb* &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;* = Optional &lt;br /&gt;
&lt;br /&gt;
Add a reference to the PostSharp.Laos and PostSharp.Public assemblies in your project. &lt;/p&gt;
&lt;p&gt;Then you have to edit your .csproj file around the existing &amp;lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&amp;gt; section to be: &lt;br /&gt;
&lt;font face="Arial"&gt;  &amp;lt;PropertyGroup&amp;gt;&lt;br /&gt;
    &amp;lt;DontImportPostSharp&amp;gt;True&amp;lt;/DontImportPostSharp&amp;gt;&lt;br /&gt;
    &amp;lt;PostSharpDirectory&amp;gt;&lt;font style="BACKGROUND-COLOR: #ffff99"&gt;lib\&lt;/font&gt;&amp;lt;/PostSharpDirectory&amp;gt;&lt;br /&gt;
  &amp;lt;/PropertyGroup&amp;gt;&lt;br /&gt;
  &amp;lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&amp;gt;&lt;br /&gt;
  &amp;lt;Import Project="$(PostSharpDirectory)PostSharp.targets" /&amp;gt;&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;You can download a working demo: &lt;font face="Arial"&gt;&lt;a href="http://rapidshare.com/files/183439996/PostSharpTest.zip.html"&gt;http://rapidshare.com/files/183439996/PostSharpTest.zip.html&lt;/a&gt; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/128673.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2009/01/14/128673.aspx</guid>
            <pubDate>Thu, 15 Jan 2009 02:32:11 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/128673.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2009/01/14/128673.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/128673.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/128673.aspx</trackback:ping>
        </item>
        <item>
            <title>Mapping an NCLOB to a String property in NHibernate</title>
            <link>http://geekswithblogs.net/wojan/archive/2008/11/10/126939.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2008/11/10/126939.aspx'&gt;http://geekswithblogs.net/wojan/archive/2008/11/10/126939.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;So I ran into an issue this evening where I needed to map a string property to a NCLOB column but I kept getting:&lt;br /&gt;
&lt;br /&gt;
&lt;font face="Courier New"&gt;"ORA-01461: can bind a LONG value only for insert into a LONG column"&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
Turns out that you should set the column type to "AnsiString" as in:&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;property&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;name&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Contents&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;column&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;CONTENTS&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;type&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;AnsiString&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;/font&gt;&lt;/font&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;- Hope this helps someone else out.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/126939.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2008/11/10/126939.aspx</guid>
            <pubDate>Tue, 11 Nov 2008 01:32:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/126939.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2008/11/10/126939.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/126939.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/126939.aspx</trackback:ping>
        </item>
        <item>
            <title>Calling a Static Method on a Generic Class</title>
            <link>http://geekswithblogs.net/wojan/archive/2008/10/23/126056.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/wojan/archive/2008/10/23/126056.aspx'&gt;http://geekswithblogs.net/wojan/archive/2008/10/23/126056.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I needed to be able to call a static method on a generic class today, so I thought I would post it up here to share with the world.  Enjoy.&lt;/p&gt;
&lt;p&gt; &lt;span style="FONT-SIZE: 10pt; COLOR: green"&gt;//Our Generic Class&lt;/span&gt;&lt;/p&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;SomeGenericClass&lt;/span&gt;&amp;lt;T&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&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: blue"&gt;char&lt;/span&gt;[] ConvertToCharArray(T something)&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;        &lt;span style="COLOR: blue"&gt;return&lt;/span&gt; something.ToString().ToCharArray();&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;strong&gt;The example code:&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green"&gt;// Get the type of the generic class&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #2b91af"&gt;Type&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; typeofClassWithGenericStaticMethod = &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;SomeGenericClass&lt;/span&gt;&amp;lt;&amp;gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green"&gt;//Get a typed version of the generic type&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #2b91af"&gt;Type&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; type = &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt;.GetType(&lt;span style="COLOR: #a31515"&gt;"System.String"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #2b91af"&gt;Type&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;[] args = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt;[] { type };&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #2b91af"&gt;Type&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; genericType = typeofClassWithGenericStaticMethod.MakeGenericType(args);&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green"&gt;// Get a reference to the method you want to call.&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #2b91af"&gt;MethodInfo&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; methodInfo = genericType&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;    .GetMethod(&lt;span style="COLOR: #a31515"&gt;"ConvertToCharArray"&lt;/span&gt;, System.Reflection.&lt;span style="COLOR: #2b91af"&gt;BindingFlags&lt;/span&gt;.Static | &lt;span style="COLOR: #2b91af"&gt;BindingFlags&lt;/span&gt;.Public);&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green"&gt;// Invoke the method with parameters. (If it doesn't have a pameter, use null instead of the object array)&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;object&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; returnValue = methodInfo.Invoke(&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: blue"&gt;object&lt;/span&gt;[]{&lt;span style="COLOR: #a31515"&gt;"Hello World"&lt;/span&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;char&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;[] characters = (&lt;span style="COLOR: blue"&gt;char&lt;/span&gt;[])returnValue;&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;foreach&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; (&lt;span style="COLOR: blue"&gt;char&lt;/span&gt; character &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; characters)&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;    &lt;span style="COLOR: #2b91af"&gt;Console&lt;/span&gt;.Write(character);&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/wojan/aggbug/126056.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Wojan</dc:creator>
            <guid>http://geekswithblogs.net/wojan/archive/2008/10/23/126056.aspx</guid>
            <pubDate>Thu, 23 Oct 2008 18:55:15 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/wojan/comments/126056.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/wojan/archive/2008/10/23/126056.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/wojan/comments/commentRss/126056.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/wojan/services/trackbacks/126056.aspx</trackback:ping>
        </item>
    </channel>
</rss>