<?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/"
	>

<channel>
	<title>Blog of Jason Grimme - Programming and All Things Jason &#187; Programming</title>
	<atom:link href="http://studioshorts.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://studioshorts.com/blog</link>
	<description>I have a computer data interchange format named after me!</description>
	<lastBuildDate>Mon, 19 Dec 2011 23:24:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Capturing Photo from a MediaCapture Camera Stream metro app / Windows 8</title>
		<link>http://studioshorts.com/blog/2011/12/capturing-photo-from-a-mediacapture-camera-stream-metro-app-windows-8/</link>
		<comments>http://studioshorts.com/blog/2011/12/capturing-photo-from-a-mediacapture-camera-stream-metro-app-windows-8/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 23:20:41 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=542</guid>
		<description><![CDATA[I was having some difficulty with saving an image from a MediaCapture webcam stream to the local system for a in a metro app. Below is what I came up with, I hope it helps. 12345678910111213141516171819202122232425262728/// &#60;summary&#62; /// Gets a picture from a MediaCapture object and saves it to a local file. &#160;Applies the image [...]]]></description>
			<content:encoded><![CDATA[<p>I was having some difficulty with saving an image from a MediaCapture webcam stream to the local system for a  in a metro app.</p>
<p>Below is what I came up with, I hope it helps.</p>
<div class="codecolorer-container csharp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span><br />
<span style="color: #008080; font-style: italic;">/// Gets a picture from a MediaCapture object and saves it to a local file. &nbsp;Applies the image to a local Image element.</span><br />
<span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span><br />
async <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> GetPictureFromPreview<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">try</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">!=</span> _mediaCaptureManager<span style="color: #008000;">&#41;</span><span style="color: #008080; font-style: italic;">// The MediaCapture object</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; var captureSettings <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> ImageEncodingProperties<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Height <span style="color: #008000;">=</span> <span style="color: #FF0000;">240</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; Width <span style="color: #008000;">=</span> <span style="color: #FF0000;">320</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; Subtype <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;JPEG&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Requires documentsLibrary capability</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; var folder <span style="color: #008000;">=</span> ApplicationData<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RoamingFolder</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; var file <span style="color: #008000;">=</span> await &nbsp;folder<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateFileAsync</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;CapturedPhoto.jpg&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; await _mediaCaptureManager<span style="color: #008000;">.</span><span style="color: #0000FF;">CapturePhotoToStorageFileAsync</span><span style="color: #008000;">&#40;</span>captureSettings, file<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MyImageElement<span style="color: #008000;">.</span><span style="color: #0000FF;">Source</span> <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> BitmapImage<span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Uri<span style="color: #008000;">&#40;</span>file<span style="color: #008000;">.</span><span style="color: #0000FF;">Path</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception ex<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; Messagebox<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> ex<span style="color: #008000;">.</span><span style="color: #0000FF;">Message</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/12/capturing-photo-from-a-mediacapture-camera-stream-metro-app-windows-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio &#8211; Test List Not Updating</title>
		<link>http://studioshorts.com/blog/2011/09/visual-studio-test-list-not-updating/</link>
		<comments>http://studioshorts.com/blog/2011/09/visual-studio-test-list-not-updating/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 16:45:36 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=530</guid>
		<description><![CDATA[I have been frustrated at the fact that I must rebuild my sollution every time I want a new test method to appear in my test list. Refreshing did not work. I discovered that there is an option which disables the discovery of new test methods, and that in Visual Studio 2010 it is enabled [...]]]></description>
			<content:encoded><![CDATA[<p>I have been frustrated at the fact that I must <strong>rebuild my sollution</strong> every time I want a new test method to appear in my test list.  <strong>Refreshing</strong> did not work.</p>
<p>I discovered that there is an option which disables the discovery of new test methods, and that in <strong>Visual Studio 2010</strong> it is enabled by default. To disable it:</p>
<ol>
<li>Tools</li>
<li>Options</li>
<li>Test Tools</li>
<li>Test Project</li>
<li>Disable background discovery of test methods</li>
</ol>
<div id="attachment_531" class="wp-caption aligncenter" style="width: 664px"><a href="http://studioshorts.com/blog/wp-content/uploads/2011/09/DisableDiscoveryOfTestMethods.png"><img src="http://studioshorts.com/blog/wp-content/uploads/2011/09/DisableDiscoveryOfTestMethods.png" alt="Disable Discovery Of Test Methods" title="Disable Discovery Of Test Methods" width="654" height="388" class="size-full wp-image-531" /></a><p class="wp-caption-text">Visual Studio: Disable Discovery Of Test Methods</p></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/09/visual-studio-test-list-not-updating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 &#8211; Cannot Start Test Project</title>
		<link>http://studioshorts.com/blog/2011/09/visual-studio-2010-cannot-start-test-project/</link>
		<comments>http://studioshorts.com/blog/2011/09/visual-studio-2010-cannot-start-test-project/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 15:29:34 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=527</guid>
		<description><![CDATA[I created a test project in Visual Studio with some unit tests in it, but was unable to run any of the tests. The test list was empty, and when I attempted to run it I got the following error: Cannot start test project so-and-so because the project does not contains any tests. Uggh I [...]]]></description>
			<content:encoded><![CDATA[<p>I created a test project in Visual Studio with some unit tests in it, but was unable to run any of the tests.  The test list was empty, and when I attempted to run it I got the following error:<br />
<strong>Cannot start test project so-and-so because the project does not contains any tests.</strong><br />
Uggh I was so frustrated! It took me about an hour to figure out my silly mistake.  I have a custom build configuration for the solution, and it was not set to build my test project.  After enabling the build, everything worked (except for my test cases, which all failed (Red, Green, Refactor!).</p>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/09/visual-studio-2010-cannot-start-test-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load All Comments on Reddit</title>
		<link>http://studioshorts.com/blog/2011/08/load-all-comments-on-reddit/</link>
		<comments>http://studioshorts.com/blog/2011/08/load-all-comments-on-reddit/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 04:48:19 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=492</guid>
		<description><![CDATA[I recently wanted to perform a search through all the comments for a Reddit story. Rather than clicking on all the &#8220;Load more comments&#8221; links, I figured I would let JavaScript do it for me. If you try to click them all at once, Reddit tends to freeze. This method allows a one second pause [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to perform a search through all the comments for a Reddit story.<br />
Rather than clicking on all the &#8220;Load more comments&#8221; links, I figured I would let JavaScript do it for me.</p>
<p>If you try to click them all at once, Reddit tends to freeze.  This method allows a one second pause between each additional load.</p>
<p>Paste the following in your address bar while on the page, and watch them load:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">javascript<span style="color: #339933;">:</span><br />
<span style="color: #003366; font-weight: bold;">function</span> loadMore<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> id <span style="color: #339933;">=</span> &nbsp;<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.button&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span> id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'loading...'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span> id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'button'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span> id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; next<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> next<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>loadMore<span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
loadMore<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>And, if it is of any use, here is the compressed version:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">javascript<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span> b<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span>1e3<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #003366; font-weight: bold;">function</span> a<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #003366; font-weight: bold;">var</span> a<span style="color: #339933;">=</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.button&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span><span style="color: #339933;">;</span><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>a<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;loading...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>a<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;button&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>a<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>b<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>a<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/08/load-all-comments-on-reddit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reading Google Chrome bookmarks with C# &amp; .net</title>
		<link>http://studioshorts.com/blog/2011/06/reading-google-chrome-bookmarks-with-c-net/</link>
		<comments>http://studioshorts.com/blog/2011/06/reading-google-chrome-bookmarks-with-c-net/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 21:14:40 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=484</guid>
		<description><![CDATA[Google Chome stores bookmarks for a given user in JSON format. With Windows, this file (Called Bookmarks) can typically be found located inside C:\Users\[user]\AppData\Local\Google\Chrome\User Data\Default . The bookmarks system contains two roots, the &#8216;Bookmarks bar&#8217; and &#8216;Other bookmarks&#8217;. Within these roots there can exist a (seemingly) infiniant amount of bookmarks and folders containing bookmarks. The [...]]]></description>
			<content:encoded><![CDATA[<p>Google Chome stores bookmarks for a given user in JSON format.  With Windows, this file (Called Bookmarks) can typically be found located inside C:\Users\[user]\AppData\Local\Google\Chrome\User Data\Default .</p>
<p>The bookmarks system contains two roots, the &#8216;Bookmarks bar&#8217; and &#8216;Other bookmarks&#8217;.  Within these roots there can exist a (seemingly) infiniant amount of bookmarks and folders containing bookmarks.<br />
The easiest way to extract the bookmarks is to use a JSON library, but I wanted to avoid adding an extra assembly to my project.  The next option is to develop a series of classes which will be used to deserialize the JSON using the .net JavaScriptSerializer class.</p>
<p>A simple bookmark JSON file looks like this:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;checksum&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;4136adb9cd06656cfcac7ed910d6c5d9&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;roots&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;bookmark_bar&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12951434934671257&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;3&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Woot One Day, One Deal&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.woot.com/&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12951434946783257&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Bookmarks bar&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;other&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12951434946783257&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;4&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Welcome to Facebook - Log In, Sign Up or Learn More&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.facebook.com/&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12951434950972257&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Other bookmarks&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;version&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>A more complex bookmark structure looks more like this:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;checksum&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;550dd4d89e2cd11eaf2b87d2aa05eaf6&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;roots&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;bookmark_bar&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12948923695706831&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;3&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Welcome to Facebook - Log In, Sign Up or Learn More&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.facebook.com/&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12948923744214264&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;7&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Jason Grimme - Web Developer in Raleigh, NC&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.studioshorts.com/&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12948923703380831&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;4&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Google&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.google.com/&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12948923708491831&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;5&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Woot<span style="color: #000099; font-weight: bold;">\u</span>00AE : One Day, One Deal<span style="color: #000099; font-weight: bold;">\u</span>2122&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.woot.com/&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950310189344299&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12951434337054697&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;10&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Sub Folder&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12951434418373129&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Bookmarks bar&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;other&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950114893839849&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;8&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Yahoo!&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.yahoo.com/&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;children&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12951434418373129&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;18&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;xkcd&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://xkcd.com/&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950313354025472&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12951434422846129&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;15&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Sub-Sub-Sub Folder&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950314249325837&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;17&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Microsoft Corporations&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.microsoft.com/en-us/default.aspx&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950313354025472&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950314249325837&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;14&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Sub-Sub folder&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950310189345299&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950310189345299&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;TestC&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950310189345299&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950313339333472&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;11&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Sub Folder&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_added&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;date_modified&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;12950310144811299&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Other bookmarks&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;folder&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;version&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h2>Deserializing Chrome Bookmarks</h2>
<p>I developed a few classes to deserialize the data into, and this is what I came up with.</p>
<div class="codecolorer-container csharp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// Contains all information about bookmarks in Chrome</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Bookmarks<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Checksum <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> Root Roots <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">int</span> Version <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// Contains 'folders' such as 'Bookmarks bar' and 'Other bookmarks'</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Root<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> RootItem Bookmark_bar <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> RootItem Other <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// A folder of bookmarks</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> RootItem<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> List<span style="color: #008000;">&lt;</span>Child<span style="color: #008000;">&gt;</span> Children <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Date_added <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Date_modified <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">int</span> Id <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">String</span> Name <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Type <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// Contains information about a specific bookmark</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Child<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> List<span style="color: #008000;">&lt;</span>Child<span style="color: #008000;">&gt;</span> Children <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> date_added <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">int</span> ID <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">String</span> Type <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> Uri Url <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp;<span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> pathToDB <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;C:\Users\username\AppData\Local\Google\Chrome\User Data\Default\Bookmarks&quot;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> pathToCopiedDB <span style="color: #008000;">=</span> <span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Path</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetTempFileName</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">File</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Copy</span><span style="color: #008000;">&#40;</span>pathToDB, pathToCopiedDB, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> jsonData <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>StreamReader streamReader <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StreamReader<span style="color: #008000;">&#40;</span>pathToCopiedDB<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jsonData <span style="color: #008000;">=</span> streamReader<span style="color: #008000;">.</span><span style="color: #0000FF;">ReadToEnd</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; streamReader<span style="color: #008000;">.</span><span style="color: #0000FF;">Close</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; JavaScriptSerializer serializer <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> JavaScriptSerializer<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Bookmarks bookmarks <span style="color: #008000;">=</span> serializer<span style="color: #008000;">.</span><span style="color: #0000FF;">Deserialize</span><span style="color: #008000;">&lt;</span>Bookmarks<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span>jsonData<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>You will now have a replica of your bookmarks in your project!  Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/06/reading-google-chrome-bookmarks-with-c-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Visual Studio &amp; XAML &#8211; IntelliSense Not Working</title>
		<link>http://studioshorts.com/blog/2011/04/visual-studio-xaml-intellisense-not-working/</link>
		<comments>http://studioshorts.com/blog/2011/04/visual-studio-xaml-intellisense-not-working/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 19:16:18 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=479</guid>
		<description><![CDATA[I&#8217;ve been working with a lot of inherited XAML code lately with Visual Studio, and have noticed that IntelliSense was not working with many of the files. It worked for some, but not others. For the files that did not work, cleaning, rebuilding, and restarting did not fix the problem. In my particular case, somebody [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with a lot of inherited XAML code lately with Visual Studio, and have noticed that IntelliSense was not working with many of the files.  It worked for some, but not others.  For the files that did not work, cleaning, rebuilding, and restarting did not fix the problem.<br />
In my particular case, somebody had improperly added additional namespaces to the XAML, and this was the cause.</p>
<h2>The Fix</h2>
<p>The fix is to add <strong>;assembly=</strong> onto the end of the custom CLR namespace.</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- Does not work --&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Window</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">xmlns:x</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">xmlns:foo</span>=<span style="color: #ff0000;">&quot;clr-namespace:Company.Product.Project.Something&quot;</span> </span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">x:Class</span>=<span style="color: #ff0000;">&quot;WpfApplication1.MainWindow&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;Window&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">Title</span>=<span style="color: #ff0000;">&quot;This Will Not Work&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- Does work --&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Window</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">xmlns:x</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">xmlns:foo</span>=<span style="color: #ff0000;">&quot;clr-namespace:Company.Product.Project.Something;assembly=&quot;</span> </span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">x:Class</span>=<span style="color: #ff0000;">&quot;WpfApplication1.MainWindow&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;Window&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">Title</span>=<span style="color: #ff0000;">&quot;This Will Work&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/04/visual-studio-xaml-intellisense-not-working/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Update SharePoint List Item(s) with Powershell</title>
		<link>http://studioshorts.com/blog/2011/01/update-sharepoint-list-items-with-powershell/</link>
		<comments>http://studioshorts.com/blog/2011/01/update-sharepoint-list-items-with-powershell/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 23:51:09 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=474</guid>
		<description><![CDATA[Today I was attempting to update every item in a SharePoint list with Powershell, which turned out to be quite the adventure. Looping through the list and grabbing the items was easy, but whenever I modified the item and called the Update() method, it either did absolutely nothing or gave me an error: &#8220;Object reference [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was attempting to update every item in a <strong>SharePoint </strong>list with <strong>Powershell</strong>, which turned out to be quite the adventure.  Looping through the list and grabbing the items was easy, but whenever I modified the item and called the <strong>Update()</strong> method, it either did absolutely nothing or gave me an error: &#8220;<em><strong>Object reference not set to an instance of an object</strong></em>&#8220;.  The frustrating thing was that other methods and properties did work on the object, and some things didn&#8217;t.<br />
I got past this once I forcibly cast the <strong>SPListItem </strong>with it&#8217;s full assembly name ([Microsoft.SharePoint.SPListItem]).  Below are two code examples.</p>
<h2>Updating a Single Item</h2>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$spSite</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.SharePoint.SPSite<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;http://SPPortal/SiteCollection&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$spWeb</span> <span style="color: pink;">=</span> <span style="color: #800080;">$spSite</span>.OpenWeb<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;StudioShorts&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$spList</span> <span style="color: pink;">=</span> <span style="color: #800080;">$spWeb</span>.Lists<span style="color: #000000;">&#91;</span><span style="color: #800000;">&quot;Posts&quot;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #800080;">$spitems</span> <span style="color: pink;">=</span> <span style="color: #800080;">$splist</span>.items<br />
<span style="color: #000000;">&#91;</span>Microsoft.SharePoint.SPListItem<span style="color: #000000;">&#93;</span><span style="color: #800080;">$spListItem</span> <span style="color: pink;">=</span> <span style="color: #800080;">$spitems</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">1</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #800080;">$spListItem</span><span style="color: #000000;">&#91;</span><span style="color: #800000;">&quot;Title&quot;</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Updating A SharePoint List Item&quot;</span>;<br />
<span style="color: #800080;">$spListItem</span>.Update<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p></p>
<h2>Updating All Items in Multiple Lists</h2>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">function</span> Update<span style="color: pink;">-</span>FieldForAllListItems<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$SPSite</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$WebName</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$ListName</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$FieldName</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$FieldValue</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$spWeb</span> <span style="color: pink;">=</span> <span style="color: #800080;">$spSite</span>.OpenWeb<span style="color: #000000;">&#40;</span><span style="color: #800080;">$WebName</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$spList</span> <span style="color: pink;">=</span> <span style="color: #800080;">$spWeb</span>.Lists<span style="color: #000000;">&#91;</span><span style="color: #800080;">$ListName</span><span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$spitems</span> <span style="color: pink;">=</span> <span style="color: #800080;">$splist</span>.items<br />
&nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$item</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$spitems</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># Casting avoids &quot;Object reference not set to an instance of an object.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.SPListItem<span style="color: #000000;">&#93;</span><span style="color: #800080;">$spListItem</span> <span style="color: pink;">=</span> <span style="color: #800080;">$item</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Updating<span style="color: #008080; font-weight: bold;">`t</span>&quot;</span> <span style="color: #800080;">$spListItem</span>.Name <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`t</span>$FieldName to $FieldValue&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$spListItem</span><span style="color: #000000;">&#91;</span><span style="color: #800080;">$FieldName</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">=</span> <span style="color: #800080;">$FieldValue</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$spListItem</span>.Update<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span> &nbsp; &nbsp; &nbsp;<br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">System.reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.SharePoint&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$spSite</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.SharePoint.SPSite<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;http://SPPortal/SPSiteCollection&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$webNames</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Uno&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;Dos&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;Tres&quot;</span><span style="color: #000000;">&#41;</span> &nbsp; <br />
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$webName</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$webNames</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; Update<span style="color: pink;">-</span>FieldForAllListItems <span style="color: pink;">-</span>SPSite <span style="color: #800080;">$spSite</span> <span style="color: pink;">-</span>WebName <span style="color: #800080;">$webName</span> <span style="color: pink;">-</span>ListName MyList <span style="color: pink;">-</span>FieldName Visibility <span style="color: pink;">-</span>FieldValue Public<br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/01/update-sharepoint-list-items-with-powershell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Updating SharePoint Database with PowerShell</title>
		<link>http://studioshorts.com/blog/2010/12/updating-sharepoint-database-with-powershell/</link>
		<comments>http://studioshorts.com/blog/2010/12/updating-sharepoint-database-with-powershell/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 23:26:38 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=445</guid>
		<description><![CDATA[Recently I needed to enable/disable a database while doing a SharePoint deployment. There is no stsadm command and we had been using a small assembly that used C Sharp to connect to the web application, get the database, and toggle the ableness of it. This worked fine, but I wanted to do it all in [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to enable/disable a database while doing a SharePoint deployment.  There is no stsadm command and we had been using a small assembly that used C Sharp to connect to the web application, get the database, and toggle the ableness of it.  This worked fine, but I wanted to do it all in PowerShell sans a compiled assembly.</p>
<p>The interesting thing about this is that normally you would expect to load the Microsoft.SharePoint assembly and then use the object model as you normally would.  However, the SPContentDatabase class is not <a href="http://msdn.microsoft.com/en-us/library/bhc3fa7f.aspx">CLS-Compliant</a> because it contains two methods for the id: id and ID.  When attempting to use any method, you get an error.  For instance:</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;"># Attempt to read the Name property</span><br />
<span style="color: #800080;">$myDatabase</span>.Name</div></td></tr></tbody></table></div>
<p>Results in:</p>
<blockquote><p>The field/property: &#8220;Id&#8221; for type: &#8220;Microsoft.SharePoint.Administration.SPContentDatabase&#8221; differs only in case from the field/property: &#8220;ID&#8221;. Failed to use non CLS compliant type.</p></blockquote>
<p>In order to get around this, you must create a Invoke  delegate sort of variable to contain methods and properties which you want to use with the class.</p>
<h3>Using Properties of Non-CLS-Compliant class</h3>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;"># Get handle on property SPContentDatabase.Name</span><br />
<span style="color: #800080;">$db_property_Name</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.Administration.SPContentDatabase<span style="color: #000000;">&#93;</span>.GetProperty<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Name&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008000;"># Get the value of the property </span><br />
<span style="color: #800080;">$current_name</span> <span style="color: pink;">=</span> <span style="color: #800080;">$db_property_Name</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800080;">$myDatabase</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008000;"># Set the value of the property</span><br />
<span style="color: #800080;">$db_property_Name</span>.SetValue<span style="color: #000000;">&#40;</span><span style="color: #800080;">$myDatabase</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;New Name&quot;</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>
<h3>Using Methods of Non-CLS-Compliant class</h3>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;"># Get handle on method SPContentDatabase.Update(bool)</span><br />
<span style="color: #800080;">$db_method_Update</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.Administration.SPContentDatabase<span style="color: #000000;">&#93;</span>.GetMethod<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Update&quot;</span><span style="color: pink;">,</span> <span style="color: #000000;">&#91;</span>System.Boolean<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />
<span style="color: #008000;"># Invoke the method SPContentDatabase.Update($true)</span><br />
<span style="color: #800080;">$db_method_Update</span>.Invoke<span style="color: #000000;">&#40;</span><span style="color: #800080;">$myDatabase</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;instance,public&quot;</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>
<h3>Bringing It All Together</h3>
<p>And with all that said, here is what I brought together to enable/disable a SharePoint database.</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">function</span> Get<span style="color: pink;">-</span>WebApplication<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$Name</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span><span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;Web Application name is required&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#41;</span> &nbsp; <br />
&nbsp; &nbsp; <span style="color: #800080;">$webApp</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.Administration.SPWebApplication<span style="color: #000000;">&#93;</span>::Lookup<span style="color: #000000;">&#40;</span><span style="color: #800080;">$Name</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$webApp</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$webApp</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><span style="color: #0000FF;">else</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Error</span> <span style="color: #800000;">&quot;Error: Cannot find webapp with name $Name&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$null</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span> &nbsp; <br />
&nbsp; &nbsp; <br />
<span style="color: #0000FF;">function</span> Get<span style="color: pink;">-</span>SPContentDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$WebApp</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span><span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;Web Application Required&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$Name</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span><span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;Database Name Required&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$webapp</span>.ContentDatabases.Count <span style="color: #FF0000;">-lt</span> <span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Error</span> <span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Error: No databases found in &quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$webapp</span>.Name<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$null</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$db_property_Name</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.Administration.SPContentDatabase<span style="color: #000000;">&#93;</span>.GetProperty<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Name&quot;</span><span style="color: #000000;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$database</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$WebApp</span>.ContentDatabases.GetEnumerator<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$current_name</span> <span style="color: pink;">=</span> <span style="color: #800080;">$db_property_Name</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800080;">$database</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span>&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$current_name</span> <span style="color: #FF0000;">-ieq</span> <span style="color: #800080;">$Name</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$database</span>&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Error</span> <span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Error: No databases named $Name found in &quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$webapp</span>.Name<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$null</span><br />
<span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #0000FF;">function</span> Set<span style="color: pink;">-</span>SPContentDatabaseStatus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$SPContentDatabase</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span><span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;Database object Required&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$Status</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span><span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;Status Required. Disabled, Offline, Online, Provisioning, Unprovisioning, Upgrading&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$PropogateFarm</span> <span style="color: pink;">=</span> <span style="color: #800080;">$false</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$db_property_Status</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.Administration.SPContentDatabase<span style="color: #000000;">&#93;</span>.GetProperty<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Status&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$db_method_Update</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.Administration.SPContentDatabase<span style="color: #000000;">&#93;</span>.GetMethod<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Update&quot;</span><span style="color: pink;">,</span> <span style="color: #000000;">&#91;</span>System.Boolean<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> &nbsp;&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #800080;">$enum_status</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.Administration.SPObjectStatus<span style="color: #000000;">&#93;</span>::<span style="color: #800080;">$Status</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$enum_status</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Error</span> <span style="color: #800000;">&quot;Error: Provided status invalid&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$null</span> <br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$currentStatus</span> <span style="color: pink;">=</span> <span style="color: #800080;">$db_property_Status</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800080;">$SPContentDatabase</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$currentStatus</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Error</span> <span style="color: #800000;">&quot;Error: Invalid database&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$null</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #800080;">$db_property_Status</span>.SetValue<span style="color: #000000;">&#40;</span><span style="color: #800080;">$SPContentDatabase</span><span style="color: pink;">,</span> <span style="color: #800080;">$enum_status</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$db_method_Update</span>.Invoke<span style="color: #000000;">&#40;</span><span style="color: #800080;">$SPContentDatabase</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;instance,public&quot;</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: pink;">,</span> <span style="color: #800080;">$PropogateFarm</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span> &nbsp; <br />
&nbsp; &nbsp; <span style="color: #800080;">$post_status</span> <span style="color: pink;">=</span> <span style="color: #800080;">$db_property_Status</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800080;">$SPContentDatabase</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$post_status</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$enum_status</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$true</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Error</span> <span style="color: #800000;">&quot;Error: Did not successfully update status from to $enum_status, stuck at $post_status&quot;</span> <br />
&nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$false</span> &nbsp; <br />
<span style="color: #000000;">&#125;</span> &nbsp; <br />
<br />
<span style="color: #008000;"># Usage</span><br />
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.SharePoint&quot;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$webApp</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>WebApplication <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;http://Web_Application_Name/&quot;</span><br />
<span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$webapp</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$database</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>SPContentDatabase <span style="color: pink;">-</span>WebAPp <span style="color: #800080;">$webApp</span> <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Database_Name&quot;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$database</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$result</span> <span style="color: pink;">=</span> Set<span style="color: pink;">-</span>SPContentDatabaseStatus <span style="color: pink;">-</span>SPContentDatabase <span style="color: #800080;">$database</span> <span style="color: #008080; font-style: italic;">-Status</span> <span style="color: #800000;">&quot;Disabled&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/12/updating-sharepoint-database-with-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick and Simple SilverLight Media Player from Expression Encoder</title>
		<link>http://studioshorts.com/blog/2010/09/quick-and-simple-silverlight-media-player-from-expression-encoder/</link>
		<comments>http://studioshorts.com/blog/2010/09/quick-and-simple-silverlight-media-player-from-expression-encoder/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 04:00:45 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SilverLight]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=436</guid>
		<description><![CDATA[If you have used Expression Encoder, you have probably seen the XAP files that it comes with to play video files. The sample code they have to embed and play the files seem to be either non existent or too complex. Below is an example for MediaPlayerTemplate.xap with a Smooth Streaming video file. If you [...]]]></description>
			<content:encoded><![CDATA[<p>If you have used <strong>Expression Encoder</strong>, you have probably seen the XAP files that it comes with to play video files.  The sample code they have to embed and play the files seem to be either non existent or too complex.</p>
<p>Below is an example for <strong>MediaPlayerTemplate.xap </strong>with a <strong>Smooth Streaming</strong> video file.  <em>If you haven&#8217;t read about Smooth Streaming, look it up! It is the technology that Netflix uses to stream movies at different quality levels.</em> While undocumented,<strong> if you are using Smooth Streaming</strong> technology you <strong>must have the SmoothStreaming.xap</strong> file in the same location as MediaPlayerTemplate.xap as it will reference it.</p>
<h3>Example Embed Object Markup</h3>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">align</span><span style="color: #66cc66;">=</span>center <span style="color: #000066;">valign</span><span style="color: #66cc66;">=</span>middle&gt;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/object.html"><span style="color: #000000; font-weight: bold;">object</span></a> <span style="color: #000066;">data</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;data:application/x-silverlight-2,&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-silverlight-2&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;300&quot;</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;source&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://server/xap/mediaplayertemplate.xap&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;autoUpgrade&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enableHtmlAccess&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enableGPUAcceleration&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;initparams&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'playerSettings = &nbsp;</span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Playlist&gt;</span></span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;AutoLoad&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>AutoLoad&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;AutoPlay&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>AutoPlay&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;DisplayTimeCode&gt;</span>false<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>DisplayTimeCode&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EnableOffline&gt;</span>false<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>EnableOffline&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EnablePopOut&gt;</span>false<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>EnablePopOut&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EnableCaptions&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>EnableCaptions&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EnableCachedComposition&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>EnableCachedComposition&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;StartMuted&gt;</span>false<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>StartMuted&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;Items&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;PlaylistItem&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">Title</span></a>&gt;</span>My Video Test<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">Title</span></a>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;Description&gt;</span>My video description<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>Description&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;IsAdaptiveStreaming&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>IsAdaptiveStreaming&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;MediaSource&gt;</span>http://SmoothStreamingServer/xap/file.ism%5Cmanifest<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>MediaSource&gt;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>PlaylistItem&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>Items&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>Playlist&gt;</span>'/&gt;<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/object.html"><span style="color: #000000; font-weight: bold;">object</span></a>&gt;</span> <br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/09/quick-and-simple-silverlight-media-player-from-expression-encoder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS, Silverlight cross site / domain requests</title>
		<link>http://studioshorts.com/blog/2010/09/iis-silverlight-cross-site-domain-requests/</link>
		<comments>http://studioshorts.com/blog/2010/09/iis-silverlight-cross-site-domain-requests/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 03:46:27 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[SilverLight]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=434</guid>
		<description><![CDATA[If you have a SilverLight application that is making requests to a site on IIS and have reached this page, it is likely you have not put into place a client access policy. IIS by default prevents requests from other domains to prevent cross-site scripting among other malicious things. Microsoft was not too creative when [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a SilverLight application that is making requests to a site on IIS and have reached this page, it is likely you have not put into place a client access policy.<br />
IIS by default prevents requests from other domains to prevent cross-site scripting among other malicious things.  Microsoft was not too creative when it came up with a solution, which they ironically borrowed from Flash.</p>
<p>You need to create your policy and name it <strong>ClientAccessPolicy.xml</strong> and you must place it at the <strong>root of your site</strong>.  Virtual directories do not count.</p>
<p>Example policy:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;access-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cross-domain-access<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-from</span> <span style="color: #000066;">http-request-headers</span>=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;domain</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/allow-from<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;grant-to<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resource</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;/&quot;</span> <span style="color: #000066;">include-subpaths</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/grant-to<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cross-domain-access<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/access-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h3>Fun fact</h3>
<p>Since the policy must be called ClientAccessPolicy.xml and you know it must be at the root of a site, you might have some fun checking for popular site policies.  For example, <a href="http://www.microsoft.com/ClientAccessPolicy.xml">Microsoft</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/09/iis-silverlight-cross-site-domain-requests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

