<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rum and Code</title>
	<atom:link href="http://rumandcode.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rumandcode.wordpress.com</link>
	<description>In Code Veritas</description>
	<lastBuildDate>Wed, 23 Nov 2011 15:54:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rumandcode.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/8600dfd9554a347312104a551846171a?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Rum and Code</title>
		<link>http://rumandcode.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rumandcode.wordpress.com/osd.xml" title="Rum and Code" />
	<atom:link rel='hub' href='http://rumandcode.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Wardacku, A Fun Silverlight Time Wasting Game</title>
		<link>http://rumandcode.wordpress.com/2010/04/22/wardacku-a-fun-silverlight-time-wasting-game/</link>
		<comments>http://rumandcode.wordpress.com/2010/04/22/wardacku-a-fun-silverlight-time-wasting-game/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 17:32:17 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Check this out]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=262</guid>
		<description><![CDATA[So, I actually wrote this a long way back when Silverlight 3 was still fresh faced but never got around to posting it.  With Windows Phone supporting Silverlight, I thought I&#8217;d get it online and maybe some feedback before I start the refactoring to make it compatible with the upcoming phones.  I&#8217;ve posted a bit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=262&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, I actually wrote this a long way back when Silverlight 3 was still fresh faced but never got around to posting it.  With Windows Phone supporting Silverlight, I thought I&#8217;d get it online and maybe some feedback before I start the refactoring to make it compatible with the upcoming phones.  I&#8217;ve posted a bit of code from the game before but might put up the whole source or tidbits if there is any interest.  Here&#8217;s a screenshot of the game.</p>
<p><a href="http://rumandcode.files.wordpress.com/2010/04/wardacku.jpg"><img class="alignnone size-medium wp-image-263" title="wardacku" src="http://rumandcode.files.wordpress.com/2010/04/wardacku.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a></p>
<p>You can play here: <a href="http://wardacku.rumandcode.com/index.htm" target="_blank">http://wardacku.rumandcode.com/index.htm</a> or hit the link on the side bar.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/262/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=262&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2010/04/22/wardacku-a-fun-silverlight-time-wasting-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2010/04/wardacku.jpg?w=300" medium="image">
			<media:title type="html">wardacku</media:title>
		</media:content>
	</item>
		<item>
		<title>Helping TTS Pronounce Words</title>
		<link>http://rumandcode.wordpress.com/2010/03/10/helping-tts-pronounce-words/</link>
		<comments>http://rumandcode.wordpress.com/2010/03/10/helping-tts-pronounce-words/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 15:47:48 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=259</guid>
		<description><![CDATA[Again, for the app I&#8217;m doing a bit of TTS and part of it is reading the weather.  I noticed that a lot of voices, Microsoft Anna for one pronounces something like &#8220;25 mph winds&#8221; as &#8220;Twenty five miles per hour whine-ds&#8221; as in &#8220;I need to wind my watch or wind up that cord.&#8221;  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=259&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Again, for the app I&#8217;m doing a bit of TTS and part of it is reading the weather.  I noticed that a lot of voices, Microsoft Anna for one pronounces something like &#8220;25 mph winds&#8221; as &#8220;Twenty five miles per hour whine-ds&#8221; as in &#8220;I need to wind my watch or wind up that cord.&#8221;  But you can put your text into an <a href="http://msdn.microsoft.com/en-us/library/bb856907.aspx" target="_blank">SSML forma</a>t and have your app SpeakSSML(string) so you can give it clues on how to read certain bits.  You can build paragraphs and sentences, speed up or slow down the reading, or fix pronunciation.  Heres a quick sample.</p>
<p><span style="color:#0000ff;">string</span> GenerateWeatherSSML(<span style="color:#0000ff;">string</span> words)</p>
<p>{</p>
<p><span style="color:#0000ff;">string</span> windsFix = <span style="color:#a31515;">&#8220;&lt;phoneme alphabet=\&#8221;x-microsoft-ups\&#8221; ph=\&#8221;W IH N D S\&#8221;&gt;winds&lt;/phoneme&gt;&#8221;</span>;</p>
<p><span style="color:#2b91af;">StringBuilder</span> finalBuilder = <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">StringBuilder</span>(<span style="color:#a31515;">&#8220;&lt;p&gt;&lt;prosody rate=\&#8221;-45%\&#8221;&gt;&#8221;</span>);</p>
<p>finalBuilder.Append(<span style="color:#a31515;">&#8221; &lt;s&gt;&#8221;</span> + words.Trim().ToLower().Replace(<span style="color:#a31515;">&#8220;winds&#8221;</span>, windsFix) + <span style="color:#a31515;">&#8220;&lt;/s&gt; &#8220;</span>);</p>
<p>finalBuilder.Append(<span style="color:#a31515;">&#8220;&lt;/prosody&gt;&lt;/p&gt; &#8220;</span>);</p>
<p><span style="color:#0000ff;">return</span> finalBuilder.ToString();</p>
<p>}</p>
<p>You need to know the <a href="http://msdn.microsoft.com/en-us/library/bb813894.aspx" target="_blank">MS phoneme alphabet</a> but it&#8217;s pretty easy once you do.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/259/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=259&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2010/03/10/helping-tts-pronounce-words/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple LINQ Example</title>
		<link>http://rumandcode.wordpress.com/2010/03/10/simple-linq-example/</link>
		<comments>http://rumandcode.wordpress.com/2010/03/10/simple-linq-example/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 15:37:04 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=256</guid>
		<description><![CDATA[I&#8217;m working on a rather large WPF app and there are bunch of little bits and bobs that I&#8217;ve noticed might be of interest or at least a nice reference for myself.  Here is one where I&#8217;m updating a user&#8217;s profile.  During the process I&#8217;m creating a bit that schedules some tasks for users.  I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=256&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a rather large WPF app and there are bunch of little bits and bobs that I&#8217;ve noticed might be of interest or at least a nice reference for myself.  Here is one where I&#8217;m updating a user&#8217;s profile.  During the process I&#8217;m creating a bit that schedules some tasks for users.  I have a static method that updates the users settings but I needed a way to make sure that I was getting rid of days they&#8217;d unchecked in addition to adding the new ones.  Heres how I checked to see what days they may have removed.</p>
<p><span style="color:#0000ff;">if</span>(oldProfile != <span style="color:#0000ff;">null</span>)<span id="_marker"> </span><span style="color:#0000ff;"><span style="color:#0000ff;">if</span></span> </p>
<p>{</p>
<p><span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">DaysOfTheWeek</span>&gt; removedDays = oldProfile.DaysToWake.Keys.Except(profile.DaysToWake.Keys).ToList&lt;<span style="color:#2b91af;">DaysOfTheWeek</span>&gt;();</p>
<p><span style="color:#0000ff;">if</span> (removedDays.Count &gt; 0)</p>
<p>{</p>
<p><span style="color:#0000ff;">foreach</span> (<span style="color:#2b91af;">DaysOfTheWeek</span> removedDay <span style="color:#0000ff;">in</span> removedDays)</p>
<p>{</p>
<p><span style="color:#2b91af;">TaskScheduleHelper</span>.DeleteTask(profile.ProfileName, removedDay);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>(oldProfile != <span style="color:#0000ff;">null</span>)</p>
<p>{</p>
<p><span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">DaysOfTheWeek</span>&gt; removedDays = oldProfile.DaysToWake.Keys.Except(profile.DaysToWake.Keys).ToList&lt;<span style="color:#2b91af;">DaysOfTheWeek</span>&gt;();</p>
<p><span style="color:#0000ff;">if</span> (removedDays.Count &gt; 0)</p>
<p>{</p>
<p><span style="color:#0000ff;">foreach</span> (<span style="color:#2b91af;">DaysOfTheWeek</span> removedDay <span style="color:#0000ff;">in</span> removedDays)</p>
<p>{</p>
<p><span style="color:#2b91af;">TaskScheduleHelper</span>.DeleteTask(profile.ProfileName, removedDay);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/256/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=256&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2010/03/10/simple-linq-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>
	</item>
		<item>
		<title>Bing Maps Silverlight Control With Traffic Cams</title>
		<link>http://rumandcode.wordpress.com/2009/09/10/bing-maps-silverlight-control-with-traffic-cams/</link>
		<comments>http://rumandcode.wordpress.com/2009/09/10/bing-maps-silverlight-control-with-traffic-cams/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 13:40:36 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Check this out]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Bing]]></category>
		<category><![CDATA[Mapping]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=221</guid>
		<description><![CDATA[So there is a CTP of the Bing Maps Silverlight SDK out there and with the discontinuation of the asp.net version it looks like this is the direction that Redmond is moving.   I&#8217;ve been playing with the controls for a few weeks now and thought I&#8217;d do a little tutorial on a practical use.  One [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=221&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So there is a <a href="http://connect.microsoft.com/silverlightmapcontrolctp" target="_blank">CTP of the Bing Maps Silverlight SDK</a> out there and with the discontinuation of the asp.net version it looks like this is the direction that Redmond is moving.   I&#8217;ve been playing with the controls for a few weeks now and thought I&#8217;d do a little tutorial on a practical use.  One of the many awesome things about using Silverlight for this is that it don&#8217;t bog down with lots of pins / objects on the map and we don&#8217;t have to deal with a lot of the AJAX and postback issues we would doing the same thing in a traditional ASP.net app.</p>
<p>So despite the bad things that people in PA have to say about PennDot, they do have a ton of public traffic cams up on the major roads so an enterprising user can check conditions if they are going anywhere around the city.</p>
<p>In this app we&#8217;re going to generate a map and pins for each cam which will pop their image into a modal child window for the user to view and refresh the image every 5 seconds</p>
<p><img class="alignnone size-full wp-image-222" title="1" src="http://rumandcode.files.wordpress.com/2009/09/1.jpg?w=600&#038;h=430" alt="1" width="600" height="430" /></p>
<p><img class="alignnone size-full wp-image-224" title="2" src="http://rumandcode.files.wordpress.com/2009/09/2.jpg?w=428&#038;h=248" alt="2" width="428" height="248" /></p>
<p>That done, the first thing we need to do is add a ref to the map assembly.</p>
<p><img class="alignnone size-full wp-image-225" title="3" src="http://rumandcode.files.wordpress.com/2009/09/3.jpg?w=357&#038;h=167" alt="3" width="357" height="167" /></p>
<p>You can do it like this.</p>
<p><img class="alignnone size-full wp-image-226" title="4" src="http://rumandcode.files.wordpress.com/2009/09/4.jpg?w=455&#038;h=269" alt="4" width="455" height="269" /></p>
<p>Then in the xaml on the main page we need to add the reference thus:</p>
<p><img class="alignnone size-full wp-image-227" title="5" src="http://rumandcode.files.wordpress.com/2009/09/5.jpg?w=600&#038;h=94" alt="5" width="600" height="94" /></p>
<p>We also add the object to the grid and give it a name.  If you run the app now you should get a normal map.  For this we&#8217;re going to need a Child Window to show the image in, so lets add one to the silverlight project.</p>
<p><img class="alignnone size-full wp-image-228" title="6" src="http://rumandcode.files.wordpress.com/2009/09/6.jpg?w=356&#038;h=93" alt="6" width="356" height="93" /></p>
<p><img class="alignnone size-full wp-image-229" title="7" src="http://rumandcode.files.wordpress.com/2009/09/7.jpg?w=600&#038;h=368" alt="7" width="600" height="368" /></p>
<p>Now that it&#8217;s added, lets go mess with the xaml a bit.</p>
<p><img class="alignnone size-full wp-image-230" title="8" src="http://rumandcode.files.wordpress.com/2009/09/8.jpg?w=470&#038;h=325" alt="8" width="470" height="325" /></p>
<p>It has it pretty well setup for us to begin with but we want to bump up the size a bit to make the images more visible and add an Image object to the grid.  We don&#8217;t need to set its Grid.Row property explicitly since it&#8217;s the only one there and will fall into place on its own.  Give it a name and jump to the code view.</p>
<p>I&#8217;m giving you all the code at once so lets just step through and see whats going on here.  First we&#8217;re taking a string in the constructor which we&#8217;ll see come in handy later and throwing it into a class variable.  We&#8217;re also setting up a DispatcherTimer which is almost exactly like an old school timer.  We preload the image and start the timer ticking every 5 seconds and instruct the callback to reload the pic each time.</p>
<p><img class="alignnone size-full wp-image-231" title="9" src="http://rumandcode.files.wordpress.com/2009/09/9.jpg?w=600&#038;h=662" alt="9" width="600" height="662" /></p>
<p>We can also see that loading the pic is super easy.  Its important however to make sure we&#8217;re not caching the image or it&#8217;ll never change.  In most cases this wouldn&#8217;t be an issue as Silverlight does this to save resources, in this case we need the opposite.</p>
<p>Now lets jump back to the main window.</p>
<p><img class="alignnone size-full wp-image-232" title="10" src="http://rumandcode.files.wordpress.com/2009/09/10.jpg?w=250&#038;h=553" alt="10" width="250" height="553" /></p>
<p>I grabbed the data off the pennDot website and put it into a nice little xml file.   It looks like this:</p>
<p><img class="alignnone size-full wp-image-233" title="11" src="http://rumandcode.files.wordpress.com/2009/09/11.jpg?w=600&#038;h=444" alt="11" width="600" height="444" /></p>
<p>With that added we need to start creating pins for the user to click to see the camera footage.</p>
<p><img class="alignnone size-full wp-image-234" title="12" src="http://rumandcode.files.wordpress.com/2009/09/12.jpg?w=445&#038;h=277" alt="12" width="445" height="277" /></p>
<p>Now lets do this with LINQ to XML, we&#8217;ll need to import the assembly because it doesn&#8217;t preload with Silverlight.</p>
<p><img class="alignnone size-full wp-image-235" title="13" src="http://rumandcode.files.wordpress.com/2009/09/13.jpg?w=457&#038;h=382" alt="13" width="457" height="382" /></p>
<p>That done we can write a little query to grab the data we need.</p>
<p><img class="alignnone size-full wp-image-236" title="14" src="http://rumandcode.files.wordpress.com/2009/09/14.jpg?w=531&#038;h=223" alt="14" width="531" height="223" /></p>
<p>Now we&#8217;ve got an anon collection we can loop through and add our pins.  We&#8217;ll want to put them all into a new MapLayer to make it easy to clear them all later if we decide to give the user the option to remove the pins and it&#8217;ll simplify placement.</p>
<p><img class="alignnone size-full wp-image-237" title="15" src="http://rumandcode.files.wordpress.com/2009/09/15.jpg?w=600&#038;h=361" alt="15" width="600" height="361" /></p>
<p>For this example I&#8217;m just making little green Ellipses for pins but you could do something nicer with ease.  You can see that the URL to the different images is predictable if we know the camera ID so we set that up and create an anon method that will run when the user clicks on an Ellipse.  The event will create an instance of our child window and point it at the camera URL the user just clicked on.  When the user is done it will release the mouse.</p>
<p>Now we add the ellipse to the new MapLayer we created and place it in the correct location.  The loop complete we add the new layer to the map.   One last change.  We&#8217;ll do the user a favor and center the map near our cameras and zoom it in so that they&#8217;re pretty well visible.</p>
<p><img class="alignnone size-full wp-image-238" title="16" src="http://rumandcode.files.wordpress.com/2009/09/16.jpg?w=600&#038;h=67" alt="16" width="600" height="67" /></p>
<p>Now lets see how we did.</p>
<p><img class="alignnone size-full wp-image-239" title="17" src="http://rumandcode.files.wordpress.com/2009/09/17.jpg?w=600&#038;h=472" alt="17" width="600" height="472" /></p>
<p>And the camera</p>
<p><img class="alignnone size-full wp-image-240" title="18" src="http://rumandcode.files.wordpress.com/2009/09/18.jpg?w=600&#038;h=448" alt="18" width="600" height="448" /></p>
<p>You can check out a live version <a href="http://www.rumandcode.com/SilverMapTraffic/BingTrafficMapExampleTestPage.aspx" target="_blank">here</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=221&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2009/09/10/bing-maps-silverlight-control-with-traffic-cams/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/1.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/3.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/4.jpg" medium="image">
			<media:title type="html">4</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/5.jpg" medium="image">
			<media:title type="html">5</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/6.jpg" medium="image">
			<media:title type="html">6</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/7.jpg" medium="image">
			<media:title type="html">7</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/8.jpg" medium="image">
			<media:title type="html">8</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/9.jpg" medium="image">
			<media:title type="html">9</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/10.jpg" medium="image">
			<media:title type="html">10</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/11.jpg" medium="image">
			<media:title type="html">11</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/12.jpg" medium="image">
			<media:title type="html">12</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/13.jpg" medium="image">
			<media:title type="html">13</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/14.jpg" medium="image">
			<media:title type="html">14</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/15.jpg" medium="image">
			<media:title type="html">15</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/16.jpg" medium="image">
			<media:title type="html">16</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/17.jpg" medium="image">
			<media:title type="html">17</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/09/18.jpg" medium="image">
			<media:title type="html">18</media:title>
		</media:content>
	</item>
		<item>
		<title>Html 4.1 Makes CSS Names Case Sensitve</title>
		<link>http://rumandcode.wordpress.com/2009/09/07/html-4-1-makes-css-names-case-sensitve/</link>
		<comments>http://rumandcode.wordpress.com/2009/09/07/html-4-1-makes-css-names-case-sensitve/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 12:18:10 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/2009/10/27/html-4-1-makes-css-names-case-sensitve/</guid>
		<description><![CDATA[We recently had to change a bunch of pages to make sure that IE and Firefox rendered them in standards mode to support some Ajax controls. It&#8217;s simple enough to add the doctype and an x-ua-compatible line for ie. What shocked me was when it broke our image buttons. They were linkbuttons with totally valid [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=245&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We recently had to change a bunch of pages to make sure that IE and Firefox rendered them in standards mode to support some Ajax controls. It&#8217;s simple enough to add the doctype and an x-ua-compatible line for ie. What shocked me was when it broke our image buttons. They were linkbuttons with totally valid css behind them. The css validated from css 1 to 2.1 and I was baffled until I noticed the button was rendering correctly on one page where by rights it shouldn&#8217;t. </p>
<p>I fired up developer tools in ie8 and firebug and saw that on the bad pages the proper class wasn&#8217;t getting picked up by the buttons at all. WTF!?!</p>
<p>Then I saw it. The name of the class on the good page was case sensitive while all the others were capitalized. Could it be so simple?  Yea, yeah it is.</p>
<p>tl;dr If you&#8217;re doing a page in HTML 4.1 standards, make sure you css classes observe case sensitivity. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=245&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2009/09/07/html-4-1-makes-css-names-case-sensitve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>
	</item>
		<item>
		<title>Images and Parameters Broken in CrystalReportViewer</title>
		<link>http://rumandcode.wordpress.com/2009/05/28/images-and-parameters-broken-in-crystalreportviewer/</link>
		<comments>http://rumandcode.wordpress.com/2009/05/28/images-and-parameters-broken-in-crystalreportviewer/#comments</comments>
		<pubDate>Thu, 28 May 2009 17:30:03 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=197</guid>
		<description><![CDATA[  I hate Crystal Reports.  I was on the verge of a nervous breakdown today after launching a well tested app and finding my reportviewer with broken images or with a mysterious javascript error saying Object Expected. The deal is that Crystal requires the aspnet_client folder that IIS creates in your Default Web Site and is accessable [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=197&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>I hate Crystal Reports.  I was on the verge of a nervous breakdown today after launching a well tested app and finding my reportviewer with broken images or with a mysterious javascript error saying Object Expected.</p>
<p><img class="alignnone size-full wp-image-198" title="CropperCapture[2]" src="http://rumandcode.files.wordpress.com/2009/05/croppercapture2.png?w=600&#038;h=44" alt="CropperCapture[2]" width="600" height="44" /></p>
<p>The deal is that Crystal requires the aspnet_client folder that IIS creates in your Default Web Site and is accessable to all the virtual folders that live there.</p>
<p>However if you try to deploy your site to a new website on the server to use a different port or subdomain using host headers you won&#8217;t have access to the aspnet_client goodness and your reports will be borked.</p>
<p> <img class="alignnone size-full wp-image-200" title="CropperCapture[1]" src="http://rumandcode.files.wordpress.com/2009/05/croppercapture11.png?w=164&#038;h=129" alt="CropperCapture[1]" width="164" height="129" /></p>
<p>You can either copy the folder into your application folder or create a virtual folder that points to the aspnet_client folder in the Default site.</p>
<p><img class="alignnone size-full wp-image-201" title="CropperCapture[4]" src="http://rumandcode.files.wordpress.com/2009/05/croppercapture4.png?w=169&#038;h=139" alt="CropperCapture[4]" width="169" height="139" /></p>
<p>and you&#8217;re golden.</p>
<p><img class="alignnone size-full wp-image-202" title="CropperCapture[3]" src="http://rumandcode.files.wordpress.com/2009/05/croppercapture3.png?w=600&#038;h=44" alt="CropperCapture[3]" width="600" height="44" /></p>
<p>I owe a co-worker with a good memory for putting me on the right scent to figure this out.  Hope this helps someone avoid the anguish this caused me.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=197&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2009/05/28/images-and-parameters-broken-in-crystalreportviewer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/05/croppercapture2.png" medium="image">
			<media:title type="html">CropperCapture[2]</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/05/croppercapture11.png" medium="image">
			<media:title type="html">CropperCapture[1]</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/05/croppercapture4.png" medium="image">
			<media:title type="html">CropperCapture[4]</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/05/croppercapture3.png" medium="image">
			<media:title type="html">CropperCapture[3]</media:title>
		</media:content>
	</item>
		<item>
		<title>Save User Data In Silverlight</title>
		<link>http://rumandcode.wordpress.com/2009/05/20/save-user-data-in-silverlight/</link>
		<comments>http://rumandcode.wordpress.com/2009/05/20/save-user-data-in-silverlight/#comments</comments>
		<pubDate>Wed, 20 May 2009 14:01:32 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=191</guid>
		<description><![CDATA[So I&#8217;m writing a little time wasting game that step-father 2.0 came up with.  It&#8217;s a sort of sudokuesque columns blend.  Of course we want to have a way to keep track of your top ten scores for bragging rights.  Anyway, in Silverlight you get, to start out, ten megs of isolated storage on each [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=191&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;m writing a little time wasting game that step-father 2.0 came up with.  It&#8217;s a sort of sudokuesque columns blend.  Of course we want to have a way to keep track of your top ten scores for bragging rights. </p>
<p>Anyway, in Silverlight you get, to start out, ten megs of isolated storage on each user&#8217;s drive to work with.  You can prompt them for more space if you like but for our purposes we&#8217;ve got plenty of room for a little text file to store the top ten scores.  <span style="color:#0000ff;"><span style="color:#0000ff;"><span> </span><span style="color:#0000ff;"><font color="#0000ff">private</p>
<p></font></span></p>
<p><span style="color:#000000;"> </span><span style="color:#0000ff;">void</span><span style="color:#000000;"> SaveScore() </span>{</p>
<p><span style="color:#2b91af;">List</span><span style="color:#a600a6;">&lt;</span><span style="color:#0000ff;">double</span><span style="color:#a600a6;">&gt;</span> scores <span style="color:#a600a6;">=</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">List</span><span style="color:#a600a6;">&lt;</span><span style="color:#0000ff;">double</span><span style="color:#a600a6;">&gt;</span>();</p>
<p><span style="color:#0000ff;">string</span> rawScores <span style="color:#a600a6;">=</span> LoadData(<span style="color:#a31515;">&#8220;scores.dat&#8221;</span>);</p>
<p><span style="color:#008000;">/* If there are scores, read them in */</span></p>
<p><span style="color:#0000ff;">if</span>(rawScores<span style="color:#a600a6;">.</span>Length <span style="color:#a600a6;">&gt;</span> <span style="color:#008000;">0</span>) {</p>
<p><span style="color:#0000ff;">string</span>[] splitScores <span style="color:#a600a6;">=</span> rawScores<span style="color:#a600a6;">.</span>Split(<span style="color:#a31515;">&#8216;;&#8217;</span>);</p>
<p>scores <span style="color:#a600a6;">=</span> splitScores<span style="color:#a600a6;">.</span>Select(a <span style="color:#a600a6;">=&gt;</span> <span style="color:#0000ff;">double</span><span style="color:#a600a6;">.</span>Parse(a))<span style="color:#a600a6;">.</span>ToList();</p>
<p>}</p>
<p>scores<span style="color:#a600a6;">.</span>Add(score);</p>
<p><span style="color:#008000;">/* Get the scores in order highest to lowest */</span></p>
<p>scores<span style="color:#a600a6;">.</span>Sort((a,b) <span style="color:#a600a6;">=&gt;</span> b<span style="color:#a600a6;">.</span>CompareTo(a));</p>
<p><span style="color:#008000;">/* Take the new top ten and semicolon delimit them */</span></p>
<p><span style="color:#0000ff;">string</span> newScores <span style="color:#a600a6;">=</span></p>
<p>scores<span style="color:#a600a6;">.</span>Take(<span style="color:#008000;">10</span>)<span style="color:#a600a6;">.</span>Aggregate(<span style="color:#a31515;">&#8220;&#8221;</span>, (a,b) <span style="color:#a600a6;">=&gt;</span> (a <span style="color:#a600a6;">+</span> <span style="color:#a31515;">&#8220;;&#8221;</span> <span style="color:#a600a6;">+</span> b))<span style="color:#a600a6;">.</span>TrimStart(<span style="color:#a31515;">&#8216;;&#8217;</span>);</p>
<p>SaveData(newScores, <span style="color:#a31515;">&#8220;scores.dat&#8221;</span>);</p>
<p>}</p>
<p><span style="color:#888888;">And the supporting methods..</span></p>
<p><span style="color:#0000ff;"><font color="#0000ff">private</p>
<p></font></span> </p>
<p><span style="color:#000000;"> </span><span style="color:#0000ff;">void</span><span style="color:#000000;"> SaveData(</span><span style="color:#0000ff;">string</span><span style="color:#000000;"> data, </span><span style="color:#0000ff;">string</span><span style="color:#000000;"> fileName) </span>{</p>
<p><span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">IsolatedStorageFile</span> isf <span style="color:#a600a6;">=</span></p>
<p><span style="color:#2b91af;">IsolatedStorageFile</span><span style="color:#a600a6;">.</span>GetUserStoreForApplication()) {</p>
<p><span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">IsolatedStorageFileStream</span> isfs <span style="color:#a600a6;">=</span></p>
<p><span style="color:#0000ff;">new</span> <span style="color:#2b91af;">IsolatedStorageFileStream</span>(fileName, <span style="color:#2b91af;">FileMode</span><span style="color:#a600a6;">.</span>Create, isf)) {</p>
<p><span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">StreamWriter</span> sw <span style="color:#a600a6;">=</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">StreamWriter</span>(isfs)) {</p>
<p>sw<span style="color:#a600a6;">.</span>Write(data);</p>
<p>sw<span style="color:#a600a6;">.</span>Close();</p>
<p>}}}}</p>
<p><span style="color:#0000ff;"><font color="#0000ff">private</p>
<p></font></span> </p>
<p><span style="color:#000000;"> </span><span style="color:#0000ff;">string</span><span style="color:#000000;"> LoadData(</span><span style="color:#0000ff;">string</span><span style="color:#000000;"> fileName) </span>{</p>
<p><span style="color:#0000ff;">string</span> data <span style="color:#a600a6;">=</span> <span style="color:#2b91af;">String</span><span style="color:#a600a6;">.</span>Empty;</p>
<p><span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">IsolatedStorageFile</span> isf <span style="color:#a600a6;">=</span> <span style="color:#2b91af;">IsolatedStorageFile</span><span style="color:#a600a6;">.</span>GetUserStoreForApplication()) {</p>
<p><span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">IsolatedStorageFileStream</span> isfs <span style="color:#a600a6;">=</span></p>
<p><span style="color:#0000ff;">new</span> <span style="color:#2b91af;">IsolatedStorageFileStream</span>(fileName, <span style="color:#2b91af;">FileMode</span><span style="color:#a600a6;">.</span>OpenOrCreate, isf)) {</p>
<p><span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">StreamReader</span> sr <span style="color:#a600a6;">=</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">StreamReader</span>(isfs)) {</p>
<p><span style="color:#0000ff;">string</span> lineOfData <span style="color:#a600a6;">=</span> <span style="color:#2b91af;">String</span><span style="color:#a600a6;">.</span>Empty;</p>
<p><span style="color:#0000ff;">while</span> ((lineOfData <span style="color:#a600a6;">=</span> sr<span style="color:#a600a6;">.</span>ReadLine()) <span style="color:#a600a6;">!=</span> <span style="color:#0000ff;">null</span>)</p>
<p>data <span style="color:#a600a6;">+=</span> lineOfData;</p>
<p>}}}</p>
<p><span style="color:#0000ff;">return</span> data;</p>
<p>}</p>
<p></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/191/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=191&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2009/05/20/save-user-data-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>
	</item>
		<item>
		<title>Empty Option in DropDownList Bound to LinqDataSource</title>
		<link>http://rumandcode.wordpress.com/2009/04/02/empty-option-in-dropdownlist-bound-to-linqdatasource/</link>
		<comments>http://rumandcode.wordpress.com/2009/04/02/empty-option-in-dropdownlist-bound-to-linqdatasource/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 13:38:29 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=185</guid>
		<description><![CDATA[This has been driving me a little crazy.  Sure if it was a completely code side binding I could insert the empty row into the datasource myself but I&#8217;m doing lots of work in ListViews of late so that option is totally out.  I ended up finding the answer on StackOverflow. &#60;asp:DropDownList ID="ddlEditEmployee" AppendDataBoundItems="true" runat="server" [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=185&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This has been driving me a little crazy.  Sure if it was a completely code side binding I could insert the empty row into the datasource myself but I&#8217;m doing lots of work in ListViews of late so that option is totally out.  I ended up finding the answer on <a href="http://stackoverflow.com/questions/278290/dropdownlist-with-linqdatasource-and-an-empty-option" target="_blank">StackOverflow</a>.</p>
<pre><span style="color:#0000ff;"><span style="color:#0000ff;">&lt;</span></span><span style="color:#a31515;">asp</span><span style="color:#0000ff;">:</span><span style="color:#a31515;">DropDownList</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">="ddlEditEmployee"</span> <span style="color:#ff0000;">AppendDataBoundItems</span><span style="color:#0000ff;">="true"</span>

<span style="color:#ff0000;">runat</span><span style="color:#0000ff;">="server"</span>

<span style="color:#ff0000;">DataTextField</span><span style="color:#0000ff;">="Value"</span> <span style="color:#ff0000;">DataValueField</span><span style="color:#0000ff;">="ID"</span>

<span style="color:#ff0000;">SelectedValue</span><span style="color:#0000ff;">='</span>&lt;%# Bind("EmployeeID") %&gt;<span style="color:#0000ff;">'</span>

<span style="color:#ff0000;">DataSourceID</span><span style="color:#0000ff;">="LinqDataSource2"&gt;</span>

<span style="color:#0000ff;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:#0000ff;">:</span><span style="color:#a31515;">ListItem</span> <span style="color:#ff0000;">Value</span><span style="color:#0000ff;">="-1"&gt;</span>

None

<span style="color:#0000ff;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:#0000ff;">:</span><span style="color:#a31515;">ListItem</span><span style="color:#0000ff;">&gt;</span>

<span style="color:#0000ff;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:#0000ff;">:</span><span style="color:#a31515;">DropDownList</span><span style="color:#0000ff;">&gt;</span></pre>
<p>The AppendDataBoundItems bit is important too otherwise sneaking that default on in there is for nothing.  Enjoy.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=185&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2009/04/02/empty-option-in-dropdownlist-bound-to-linqdatasource/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>
	</item>
		<item>
		<title>Clean Complex Databinding in ASP.Net</title>
		<link>http://rumandcode.wordpress.com/2009/04/02/clean-complex-databinding-in-aspnet/</link>
		<comments>http://rumandcode.wordpress.com/2009/04/02/clean-complex-databinding-in-aspnet/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 12:47:05 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=179</guid>
		<description><![CDATA[So I needed to do a little CRUD ListView for a simple app I&#8217;m working on.  One of the columns is an image path that I was using an Image object to display.  The object got vetoed and I&#8217;m going with text now so I wanted a clean way to either show a simple text [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=179&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I needed to do a little CRUD ListView for a simple app I&#8217;m working on.  One of the columns is an image path that I was using an Image object to display.  The object got vetoed and I&#8217;m going with text now so I wanted a clean way to either show a simple text link to pop the image on a new tab or show that no image was available.  I went with this in the template:</p>
<pre><span style="color:#0000ff;"><span style="color:#0000ff;">&lt;</span></span><span style="color:#a31515;">td</span><span style="color:#0000ff;">&gt;</span>&lt;%<span style="color:#0000ff;">#</span> GenerateImageField(Eval(<span style="color:#a31515;">"ImagePath"</span>)) %&gt; <span style="color:#0000ff;">&lt;/</span><span style="color:#a31515;">td</span><span style="color:#0000ff;">&gt;</span></pre>
<p> </p>
<pre>public string GenerateImageField(object dataItem){
if (dataItem == null || string.IsNullOrEmpty(dataItem.ToString()))
{
return "No Image";
}
return @"&lt;a href='"+ dataItem.ToString() +@"' target='_blank'&gt;Image&lt;/a&gt;";
}</pre>
<p><span style="color:#000000;">This works out rather well.</span></p>
<pre><img class="alignnone size-full wp-image-183" title="croppercapture1" src="http://rumandcode.files.wordpress.com/2009/04/croppercapture1.png?w=395&#038;h=107" alt="croppercapture1" width="395" height="107" /></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=179&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2009/04/02/clean-complex-databinding-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>

		<media:content url="http://rumandcode.files.wordpress.com/2009/04/croppercapture1.png" medium="image">
			<media:title type="html">croppercapture1</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.Net Server Control Tag For QueryString</title>
		<link>http://rumandcode.wordpress.com/2009/03/26/aspnet-server-control-tag-for-querystring/</link>
		<comments>http://rumandcode.wordpress.com/2009/03/26/aspnet-server-control-tag-for-querystring/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 15:13:18 +0000</pubDate>
		<dc:creator>echostorm</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rumandcode.wordpress.com/?p=170</guid>
		<description><![CDATA[Maybe I&#8217;m just lucky but I&#8217;ve only had to use control tags in ASP.Net apps very infrequently and I always forget how they work until I need them again.  Sherlock Holmes would say thats a good thing but I&#8217;m going to post a little example here for my own benefit.  I LOVE the ListView control [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=170&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Maybe I&#8217;m just lucky but I&#8217;ve only had to use control tags in ASP.Net apps very infrequently and I always forget how they work until I need them again.  Sherlock Holmes would say thats a good thing but I&#8217;m going to post a little example here for my own benefit. </p>
<p>I LOVE the ListView control that we got in 3.5 and I&#8217;m using it alot in the dinky apps I&#8217;m banging out of late.  For this one I needed to create a little link in the grid for each row using the current querystring and the row&#8217;s ID.</p>
<p><span style="color:#0000ff;"><font color="#0000ff">&lt;</p>
<p></font></span><span style="color:#a31515;">asp</span><span style="color:#0000ff;">:</span><span style="color:#a31515;">ListView</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&#8221;lvLicenses&#8221;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&#8221;server&#8221;</span> <span style="color:#ff0000;">DataSourceID</span><span style="color:#0000ff;">=&#8221;dsEmployeeLicense&#8221;&gt;</span></p>
<p><span style="color:#0000ff;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:#0000ff;">&gt;</span></p>
<p><span style="color:#0000ff;">&lt;</span><span style="color:#a31515;">tr</span> <span style="color:#ff0000;">style</span><span style="color:#0000ff;">=&#8221;</span><span style="color:#ff0000;">background-color</span>: <span style="color:#0000ff;">#E0FFFF</span>;<span style="color:#ff0000;">color</span>: <span style="color:#0000ff;">#333333</span>;<span style="color:#0000ff;">&#8220;&gt;</span></p>
<p><span style="color:#0000ff;">&lt;</span><span style="color:#a31515;">td</span><span style="color:#0000ff;">&gt;</span></p>
<p><span style="color:#0000ff;">&lt;</span><span style="color:#a31515;">a</span> <span style="color:#ff0000;">href</span><span style="color:#0000ff;">=&#8217;EmployeeLicense.aspx?EmpID=</span>&lt;%=Request.QueryString["ID"]%&gt;<span style="color:#0000ff;">&amp;ID=</span>&lt;%# Eval(&#8220;ID&#8221;) %&gt;<span style="color:#0000ff;">&#8216;</span> <span style="color:#ff0000;">target</span><span style="color:#0000ff;">=&#8221;_self&#8221;&gt;</span>Edit<span style="color:#0000ff;">&lt;/</span><span style="color:#a31515;">a</span><span style="color:#0000ff;">&gt;</span></p>
<p><span style="color:#0000ff;">&lt;/</span><span style="color:#a31515;">td</span><span style="color:#0000ff;">&gt;</span></p>
<p>Easy as pie.  mmm pie.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rumandcode.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rumandcode.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rumandcode.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rumandcode.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rumandcode.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rumandcode.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rumandcode.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rumandcode.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rumandcode.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rumandcode.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rumandcode.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rumandcode.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rumandcode.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rumandcode.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rumandcode.wordpress.com&amp;blog=520201&amp;post=170&amp;subd=rumandcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rumandcode.wordpress.com/2009/03/26/aspnet-server-control-tag-for-querystring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91532960def18c2da5ce01616ebdc5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">echostorm</media:title>
		</media:content>
	</item>
	</channel>
</rss>
