<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Kev'n Roberts</title><subtitle type="html" /><id>http://weblogs.asp.net/kevnroberts/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/kevnroberts/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/kevnroberts/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2008-03-31T12:43:00Z</updated><entry><title>Regular Expressions Are Your Friend</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/kevnroberts/archive/2009/06/26/regular-expressions-are-your-friend.aspx" /><id>http://weblogs.asp.net/kevnroberts/archive/2009/06/26/regular-expressions-are-your-friend.aspx</id><published>2009-06-26T17:43:00Z</published><updated>2009-06-26T17:43:00Z</updated><content type="html">
&lt;p&gt;&amp;nbsp;I recently came across this JavaScript code:&lt;/p&gt;
&lt;blockquote&gt;
&lt;code&gt;function phonescrub(elmt){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; str=elmt.value;str2="";ii=0;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (ii &amp;lt; str.length){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ch=str.charAt(ii);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; kk=0;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while (kk &amp;lt; 10){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (ch==""+kk){str2=str2+ch};&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; kk++;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ii++;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elmt.value=str2;&lt;br&gt;}&lt;/code&gt;
&lt;/blockquote&gt;
&lt;p&gt;It's a little difficult to decipher, so I'll interpret it.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start with the current value of the input element (str).&lt;/li&gt;
&lt;li&gt;Initialize the return value (str2) and an indexer (ii).&lt;/li&gt;
&lt;li&gt;Loop through each character in string "str."&lt;/li&gt;
&lt;li&gt;Loop through the numers 0 to 9.&lt;/li&gt;
&lt;li&gt;If the current character (ch) is equal to the number (kk) then append that character to the output string (str2).&lt;/li&gt;
&lt;li&gt;Increment kk [End number loop]&lt;/li&gt;
&lt;li&gt;Increment ii [End character loop]&lt;/li&gt;
&lt;li&gt;Assign the new value (str2) to the input element's value property.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Essentially, what this function does is it strips out all non-numeric characters.&lt;/p&gt;
&lt;p&gt;This function has several issues (not the least of which is the variable names "str" and "str2"). But the main issue is the complexity. The method is 11 lines long and it took me 8 steps to explain what it is doing.&lt;/p&gt;
&lt;p&gt;Using Regular Expressions, we can reduce 11 lines to 1:&lt;/p&gt;
&lt;blockquote&gt;
&lt;code&gt;function phonescrub(elmt){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elmt.value = elmt.value.replace(/[^0-9]/g, '');&lt;br&gt;}&lt;/code&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here is what this new function does:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Replace all non-numeric characters in the input element's value with an empty string.&lt;/li&gt;
&lt;li&gt;Assign that new string to the value of the input element.&lt;/li&gt;
&lt;/ol&gt;
It really doesn't get much simpler than that. And there are no quirky variables (like str and str2).&lt;br&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7135092" width="1" height="1"&gt;</content><author><name>kevnroberts</name><uri>http://weblogs.asp.net/members/kevnroberts.aspx</uri></author><category term="RegEx" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/RegEx/default.aspx" /><category term="JavaScript" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/JavaScript/default.aspx" /><category term="Regular Expressions" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/Regular+Expressions/default.aspx" /></entry><entry><title>ValidationGroup on the ValidationSummary Control</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/kevnroberts/archive/2008/05/12/validationgroup-on-the-validationsummary-control.aspx" /><id>http://weblogs.asp.net/kevnroberts/archive/2008/05/12/validationgroup-on-the-validationsummary-control.aspx</id><published>2008-05-13T03:44:00Z</published><updated>2008-05-13T03:44:00Z</updated><content type="html">&lt;p&gt;Today I learned an important lesson about the ValidationSummary control. But first, some background.&lt;/p&gt;&lt;p&gt;The bug I was working on was this: the validation summary did not display the validation errors. The page would repost and redisplay, but there was no messaging as to what might be wrong. &lt;/p&gt;&lt;p&gt;The page was set up in a wizard sort of fashion with about three Panel controls that are displayed selectively, depending on which step the user is on. In order to prevent all the validation controls to fire every time a button is clicked, the various validators were assigned to different validation groups, one for each Panel.&amp;nbsp;&lt;/p&gt;&lt;p&gt;It took me about an hour before I &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.validationsummary.validationgroup%28VS.80%29.aspx" title="ValidationSummary.ValidationGroup Property" mce_href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.validationsummary.validationgroup(VS.80).aspx"&gt;discovered this truth&lt;/a&gt;:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;"When you specify a value for the &lt;b&gt;ValidationSummary&lt;/b&gt; property, only 
error messages from the validation controls that are part of the specified group 
are summarized. If you do not set a value for this property, all error messages 
from validation controls on the page that are not assigned to a validation group 
are summarized."&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;The first time I read it, I was in a hurry and didn't catch the very last part: "...&lt;i&gt;that are not assigned to a validation group...&lt;/i&gt;" I guess it is important to read all the documentation.&lt;/p&gt;&lt;p&gt;My bug was that the ValidationSummary did not specify a validation group. According to the docs, that means that only validators that are not assigned a ValidationGroup will show up in the summary control. It was an easy fix (set the validation group when I set which panel to display), but it took me about an hour to figure it out.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6185295" width="1" height="1"&gt;</content><author><name>kevnroberts</name><uri>http://weblogs.asp.net/members/kevnroberts.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/ASP.NET/default.aspx" /><category term="Validation" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/Validation/default.aspx" /></entry><entry><title>Session Dump Utility</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/kevnroberts/archive/2008/05/04/session-dump-utility.aspx" /><link rel="enclosure" type="application/zip" length="1965" href="http://weblogs.asp.net/kevnroberts/attachment/6158030.ashx" /><id>http://weblogs.asp.net/kevnroberts/archive/2008/05/04/session-dump-utility.aspx</id><published>2008-05-05T03:12:00Z</published><updated>2008-05-05T03:12:00Z</updated><content type="html">&lt;p&gt;I'm currently working on a project where we are storing quite a bit of data in Session for the user. Naturally, QA had a hard time testing whether or not something actually was stored in Session. So, we wrote a little page that showed the values of what we put in Session. The problem with this approach is that every time we added another item to Session, or removed an item, we would have to fix this page to include the new and remove the old. It got to be very tiresome.&lt;/p&gt;&lt;p&gt;I had just finished doing some work with reflection (my first time ever). And it occurred to me that I could use reflection to show everything that was stored in Session in such a way that it could be written once and never need to be updated.&lt;/p&gt;&lt;p&gt;Here's the basic rundown of what the utility does (see attached .zip file):&lt;br&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;On the page load, iterate over all items in Session&lt;/li&gt;&lt;li&gt;Print the Key of the item&lt;/li&gt;&lt;li&gt;If the value of the item is a native data type (int, bool, decimal -- including String and DateTime objects) print the value&lt;/li&gt;&lt;li&gt;If the value is an object...&lt;/li&gt;&lt;li&gt;Iterate over all the public properties of the object&lt;/li&gt;&lt;li&gt;Print the Property Name&lt;/li&gt;&lt;li&gt;If the value of the Property is a native data type, print it&lt;/li&gt;&lt;li&gt;If it is an object, GOTO #5&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;In the end, I always get to a native data type (or String or DateTime), so we wouldn't end up in an endless loop. Here's a sample of what it displays:&lt;/p&gt;&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/kevnroberts/SessionDump.jpg" mce_href="http://weblogs.asp.net/blogs/kevnroberts/SessionDump.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/kevnroberts/SessionDump.jpg" mce_src="http://weblogs.asp.net/blogs/kevnroberts/SessionDump.jpg" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As an added bonus, it will also display the approximate size of all the objects (in bytes/kilobytes).&lt;/p&gt;&lt;p&gt;This utility has been very helpful for me, to make sure I know what is in Session, without having to step through the code in debug mode and stop and interrogate the Session object to find the specific value (or values) I'm looking for. This has also been very helpful to QA so that they can see what is put into Session.&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6158030" width="1" height="1"&gt;</content><author><name>kevnroberts</name><uri>http://weblogs.asp.net/members/kevnroberts.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/ASP.NET/default.aspx" /><category term="Utilities" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/Utilities/default.aspx" /></entry><entry><title>Legacy URLs and RegEx</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/kevnroberts/archive/2008/04/09/legacy-urls-and-regex.aspx" /><id>http://weblogs.asp.net/kevnroberts/archive/2008/04/09/legacy-urls-and-regex.aspx</id><published>2008-04-10T03:45:00Z</published><updated>2008-04-10T03:45:00Z</updated><content type="html">
&lt;p&gt;At my day job, we're in the process of an enterprise re-write. The old stuff is a hodge-podge of Cold Fusion, Java, J# and C#. The website is Cold Fusion so the URLs often look something like this:&lt;/p&gt;

&lt;code&gt;http://www.example.com/products/product_details/index.cfm?fuseaction=foo&lt;/code&gt;

&lt;p&gt;The new site is ASP.NET. Naturally, the URLs will look somewhat like this:&lt;/p&gt;

&lt;code&gt;http://www.example.com/products/details.aspx?item=foo&lt;/code&gt;

&lt;p&gt;I'm sure that many of you have been involved in a scenario like this. The business wants to update the site. But we don't want to lose all the SEO ground we've gained over the years. So we have to support the legacy URLs.&lt;/p&gt;

&lt;p&gt;There are different ways to tackle this problem: map the ".cfm" extension to be handled by ASP.NET using a custom &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ihttphandler.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.web.ihttphandler.aspx"&gt;IHttpHandler&lt;/a&gt;; or use an &lt;a href="http://en.wikipedia.org/wiki/ISAPI" title="Internet Server Application Programming Interface" mce_href="http://en.wikipedia.org/wiki/ISAPI"&gt;ISAPI&lt;/a&gt; filter; or use a third party URL Rewriter. In the end, most (if not all) of these methods rely on Regular Expressions.&lt;/p&gt;

&lt;p&gt;Regular Expressions are powerful, but they can be confusing, and many developers avoid them. They're like the ultra-geeky kid in school. You don't really want to associate with him, but you'd love it if he was your lab partner, because you know he'd carry you through anything that you didn't understand.&lt;/p&gt;

&lt;p&gt;The task to write the RegExes to match the Legacy URLs with the new URLs has fallen to me. And I'm actually happy about that. The best for me to learn anything is by doing it. So I get to sink my teeth into Regex and hopefully, I won't forget what I learned anytime soon.&lt;/p&gt;

&lt;p&gt;And now, the good part - links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx"&gt;Tip/Trick: Url Rewriting with ASP.NET&lt;/a&gt; by none other than &lt;a href="http://weblogs.asp.net/scottgu" mce_href="http://weblogs.asp.net/scottgu"&gt;Scott Guthrie&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://immike.net/blog/2007/04/06/the-absolute-bare-minimum-every-programmer-should-know-about-regular-expressions/" mce_href="http://immike.net/blog/2007/04/06/the-absolute-bare-minimum-every-programmer-should-know-about-regular-expressions/"&gt;The absolute bare minimum every programmer should know about regular expressions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://regexlib.com/CheatSheet.aspx" mce_href="http://regexlib.com/CheatSheet.aspx"&gt;RegExLib.com Regular Expression Cheat Sheet (.NET)&lt;/a&gt; on &lt;a href="http://regexlib.com" mce_href="http://regexlib.com"&gt;RegExLib.com&lt;/a&gt; - a great resource for Regular Expressions. Why go through the brain damage when someone else already willing did so?&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6081092" width="1" height="1"&gt;</content><author><name>kevnroberts</name><uri>http://weblogs.asp.net/members/kevnroberts.aspx</uri></author><category term="RegEx" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/RegEx/default.aspx" /></entry><entry><title>MVC and AJAX</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/kevnroberts/archive/2008/04/07/mvc-and-ajax.aspx" /><id>http://weblogs.asp.net/kevnroberts/archive/2008/04/07/mvc-and-ajax.aspx</id><published>2008-04-08T03:07:00Z</published><updated>2008-04-08T03:07:00Z</updated><content type="html">
&lt;p&gt;I have recently been learning about the new &lt;a href="http://www.asp.net/MVC" title="Model, View, Controller" mce_href="http://www.asp.net/MVC"&gt;MVC&lt;/a&gt; framework offered by friends at &lt;a href="http://www.asp.net" mce_href="http://www.asp.net"&gt;ASP.NET&lt;/a&gt;. One of the first questions I had about it was how does &lt;acronyn title="Asynchronous JavaScript And XML"&gt;AJAX fit into this framework. So, I did a little digging. I found &lt;a href="http://www.nikhilk.net/" mce_href="http://www.nikhilk.net/"&gt;Nikhil Kothari&lt;/a&gt;'s article on "&lt;a href="http://www.nikhilk.net/Ajax-MVC.aspx"&gt;Ajax with the ASP.NET MVC Framework&lt;/a&gt;," but that is not quite what I was looking for. &lt;/acronyn&gt;&lt;/p&gt;
&lt;p&gt;(Awhile back, I stumbled across &lt;a href="http://robbagby.com" mce_href="http://robbagby.com"&gt;Rob Bagby&lt;/a&gt;'s &lt;a href="http://blogs.msdn.com/bags/archive/2007/06/07/latest-asp-net-client-libraries-webcast-sample-code-and-links-to-all-sessions.aspx" mce_href="http://blogs.msdn.com/bags/archive/2007/06/07/latest-asp-net-client-libraries-webcast-sample-code-and-links-to-all-sessions.aspx"&gt;webcasts on the ASP.NET AJAX client libraries&lt;/a&gt; wherein he details the benefits of getting your hands dirty with the JavaScript, instead of letting the UpdatePanel control write all the JavaScript for you. And he goes into detail on how to accomplish that task. He didn't need to do much convincing of me. I've long thought that while the UpdatePanel is very convenient (especially for those who loath JavaScript), it is probably somewhat bloated. In the end, I prefer Rob Bagby's way.)&lt;/p&gt;
&lt;p&gt;I was looking for a method that fit within the MVC framework, but didn't deliver HTML from an AJAX call, but rather straight XML, or better yet JSON. I did some more searching and found that &lt;a href="http://www.aaronlerch.com/blog/" mce_href="http://www.aaronlerch.com/blog/"&gt;Aaron Lerch&lt;/a&gt; celebrated the new year with a post titled &lt;a href="http://www.aaronlerch.com/blog/2008/01/01/unifying-web-sites-and-web-services-with-the-aspnet-mvc-framework/"&gt;Unifying Web "Sites" and Web Services with the ASP.NET MVC Framework&lt;/a&gt;, wherein he describes how one could go about returning XML or JSON through the MVC framework by simply passing the data to a view and the view determining what form it should send back to the client. I downloaded his provided code only to find that it doesn't work with the latest version of the MVC framework. (Not that this is a big deal. I'm sure I could just study the new framework and re-write it.)&lt;/p&gt;&lt;p&gt;I also found &lt;a href="http://forums.asp.net/p/1234474/2248048.aspx#2248048" mce_href="http://forums.asp.net/p/1234474/2248048.aspx#2248048"&gt;this interesting post&lt;/a&gt; by Dan Finch in the forums. It is basically the same concept that Aaron proposed, only less code.&lt;/p&gt;&lt;p&gt;I don't know which is better yet. I'm just learning about this stuff. But I do like how these solutions deliver XML or JSON and they use the MVC framework to deliver it. I'll be keeping an eye out for more like this. &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6073778" width="1" height="1"&gt;</content><author><name>kevnroberts</name><uri>http://weblogs.asp.net/members/kevnroberts.aspx</uri></author><category term="MVC" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/MVC/default.aspx" /><category term="AJAX" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/AJAX/default.aspx" /></entry><entry><title>Object Serializer Utility</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/kevnroberts/archive/2008/04/03/object-serializer-utility.aspx" /><id>http://weblogs.asp.net/kevnroberts/archive/2008/04/03/object-serializer-utility.aspx</id><published>2008-04-03T18:42:00Z</published><updated>2008-04-03T18:42:00Z</updated><content type="html">&lt;p&gt;Utilities are among my favorites to code. Especially ones that are short and sweet and useful in many different situations. One of my favorites that I wrote was an Object Serializer. &lt;/p&gt;
&lt;p&gt;Most examples of object serialization I have seen end up serializing an object to an XML file. That does have it's purpose. However, I've been in many situations where I'd like to serialize an object into XML and use the XML in code. Or I have XML in the form of a string which I need converted to an object.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx"&gt;XmlSerializer&lt;/a&gt; is what we need. And if you look at the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.serialize.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.serialize.aspx"&gt;Serialize&lt;/a&gt; or &lt;a href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.deserialize.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.deserialize.aspx"&gt;Deserialize&lt;/a&gt; methods, you see that we have a lot of different options. We need some sort of Writer or Reader in order to do the conversion. Since I want to serialize to and deserialize from a string, the obvious choice was the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.stringwriter.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.io.stringwriter.aspx"&gt;StringWriter&lt;/a&gt; (to serialize) and the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.stringreader.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.io.stringreader.aspx"&gt;StringReader&lt;/a&gt; (to deserialize).&lt;/p&gt;
&lt;p&gt;It is important to note that both the StringWriter and StringReader classes implement IDisposable and the documentation suggests that we should always dispose of our Reader/Writer when we're done with it. I'm a big fan of the "using" statement which automatically calls the Dispose() method when it leaves the using block.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;I also decided to use generics so that I could have a strongly typed object going in and coming out.&lt;/p&gt;
&lt;p&gt;So without further ado, here it is:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: 'Lucida Console'; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console'; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console'; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt; System.IO;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console'; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt; System.Text;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console'; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt; System.Xml.Serialization;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida onsole';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console'; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt; KevnRoberts.Utilities&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Used for serializing and deserializing objects&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;typeparam
name="T"&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;The type of object to
de/serialize&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/typeparam&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Serializer&lt;/span&gt;&amp;lt;T&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Converts the XML into an object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;param
name="xml"&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;The XML representation
of an object.&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/param&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;An object of type T.&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/returns&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T Deserialize(&lt;span style="color: blue;"&gt;string&lt;/span&gt;
xml)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//
convert to the serializable object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;T item;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;
(&lt;span style="color: rgb(43, 145, 175);"&gt;StringReader&lt;/span&gt; reader = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;StringReader&lt;/span&gt;(xml))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializer&lt;/span&gt;
serializer = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializer&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;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;item =
(T)serializer.Deserialize(reader);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;
item;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Converts an object into XML.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;param
name="obj"&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;The object to convert.&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/param&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;The XML representation of the object.&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/returns&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt;
Serialize(T obj)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;StringBuilder&lt;/span&gt;
data = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;StringBuilder&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;
(&lt;span style="color: rgb(43, 145, 175);"&gt;StringWriter&lt;/span&gt; writer = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;StringWriter&lt;/span&gt;(data))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializer&lt;/span&gt;
serializer = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;XmlSerializer&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;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;serializer.Serialize(writer,
obj);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;
data.ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br&gt;

&lt;span style="font-size: 10pt; font-family: 'Lucida Console';"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;


&lt;p&gt;And here is an example of how you would use it:&lt;br&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;&lt;span style="background: white none repeat scroll 0% 50%; font-size: 10pt; font-family: 'Lucida Console'; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;string&lt;/span&gt;&lt;span style="background: white none repeat scroll 0% 50%; font-size: 10pt; font-family: 'Lucida Console'; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; xml = &lt;span style="color: rgb(163, 21, 21);"&gt;@"&amp;lt;dateTime&amp;gt;2008-04-03T00:00:00&amp;lt;/dateTime&amp;gt;"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="background: white none repeat scroll 0% 50%; font-size: 10pt; font-family: 'Lucida Console'; color: rgb(43, 145, 175); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;DateTime&lt;/span&gt;&lt;span style="background: white none repeat scroll 0% 50%; font-size: 10pt; font-family: 'Lucida Console'; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; deserializedDate = &lt;span style="color: rgb(43, 145, 175);"&gt;Serializer&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;&amp;gt;.Deserialize(xml);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="background: white none repeat scroll 0% 50%; font-size: 10pt; font-family: 'Lucida Console'; color: rgb(43, 145, 175); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;DateTime&lt;/span&gt;&lt;span style="background: white none repeat scroll 0% 50%; font-size: 10pt; font-family: 'Lucida Console'; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; date = &lt;span style="color: blue;"&gt;new&lt;/span&gt;
&lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;(2008, 4, 3);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="background: white none repeat scroll 0% 50%; font-size: 10pt; font-family: 'Lucida Console'; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;string&lt;/span&gt;&lt;span style="background: white none repeat scroll 0% 50%; font-size: 10pt; font-family: 'Lucida Console'; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; serializedDate = &lt;span style="color: rgb(43, 145, 175);"&gt;Serializer&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;&amp;gt;.Serialize(date);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;br&gt;Of course, you'll want to use it to de/serialize something more complex than a date and time, but you get the point.&lt;br&gt;&lt;/p&gt;


&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6062995" width="1" height="1"&gt;</content><author><name>kevnroberts</name><uri>http://weblogs.asp.net/members/kevnroberts.aspx</uri></author><category term="Utilities" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/Utilities/default.aspx" /></entry><entry><title>Developer Barbarian</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/kevnroberts/archive/2008/03/31/developer-barbarian.aspx" /><id>http://weblogs.asp.net/kevnroberts/archive/2008/03/31/developer-barbarian.aspx</id><published>2008-03-31T18:43:00Z</published><updated>2008-03-31T18:43:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://danhounshell.com/blogs/dan/default.aspx" mce_href="http://danhounshell.com/blogs/dan/default.aspx"&gt;Dan Hounshell&lt;/a&gt; &lt;a href="http://danhounshell.com/blogs/dan/archive/2008/03/24/what-is-wrong-with-the-asp-net-community.aspx" title="What is wrong with the ASP.NET Community?" mce_href="http://danhounshell.com/blogs/dan/archive/2008/03/24/what-is-wrong-with-the-asp-net-community.aspx"&gt;suggested that&lt;/a&gt; in the ASP.NET community, there are three types of people:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Community Leaders&lt;/li&gt;
&lt;li&gt;Practical Experts&lt;/li&gt;
&lt;li&gt;Developers (i.e. everyone else) &lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;
The Community Leaders, he writes, are the people who steer the community. He names &lt;a href="http://weblogs.asp.net/scottgu" title="ScottGu"&gt;Scott Guthrie&lt;/a&gt; as the primary steerer. The Practical Experts are people like himself. The ones that write books, present at events, have much read blogs.&lt;/p&gt;&lt;p&gt;Then there are the rest of us. He just calls us "Developers," but I like the term "Developer &lt;a href="http://en.wikipedia.org/wiki/Barbarian" mce_href="http://en.wikipedia.org/wiki/Barbarian"&gt;Barbarians&lt;/a&gt;." The Greeks called anyone who wasn't a Greek a Barbarian. Its the "there's Us and everyone who isn't Us" type thing.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Don't get me wrong. I'm not saying that anyone is condescending to us. And I'm certainly not saying that Dan is saying this. These are my words, not Dan's.&lt;/p&gt;&lt;p&gt;In fact, I like the fact that I'm a Developer Barbarian. I know enough to know that I don't know much. That is what makes me a barbarian. I aspire to move up to the "Practical Experts" level, but I'm not there yet.&lt;/p&gt;&lt;p&gt;I wouldn't say that I follow the community and don't study it. I do both. And I do actively seek out better ways to do things. But I'm not always in a position to follow it through to implementation. And most of the time, the "better way" that I found is something that came from the community.&lt;br&gt;&lt;/p&gt;&lt;p&gt;One of the things that I love about software development is that I get to learn new stuff all the time. In fact, if I don't, I'll either search out new stuff to learn (if the job allows it) or I'll look for a new job. And, if time allows, I'll learn stuff on my own at home.&lt;/p&gt;&lt;p&gt;That's what I here to do. Learn. Because it's true. I'm a Developer Barbarian. But I don't want to stay that way.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6052914" width="1" height="1"&gt;</content><author><name>kevnroberts</name><uri>http://weblogs.asp.net/members/kevnroberts.aspx</uri></author><category term="Community" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/Community/default.aspx" /><category term="ASP.NET" scheme="http://weblogs.asp.net/kevnroberts/archive/tags/ASP.NET/default.aspx" /></entry></feed>