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

<channel>
	<title>Fernando Machado Píriz&#039;s Blog</title>
	<atom:link href="http://fernandomachadopirizen.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://fernandomachadopirizen.wordpress.com</link>
	<description>Posts about .NET Framework, C#, and related topics</description>
	<lastBuildDate>Fri, 15 Apr 2011 22:19:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='fernandomachadopirizen.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/dc96fdec330b90a37ab7b652d4c30d59?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Fernando Machado Píriz&#039;s Blog</title>
		<link>http://fernandomachadopirizen.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://fernandomachadopirizen.wordpress.com/osd.xml" title="Fernando Machado Píriz&#039;s Blog" />
	<atom:link rel='hub' href='http://fernandomachadopirizen.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Connecting an Hyper-V Virtual Machine to the Internet through a Wireless Connection</title>
		<link>http://fernandomachadopirizen.wordpress.com/2011/03/26/connecting-an-hyper-v-virtual-machine-to-the-internet-through-a-wireless-connection/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2011/03/26/connecting-an-hyper-v-virtual-machine-to-the-internet-through-a-wireless-connection/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 11:33:08 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Hyper-V;Windows Server]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2011/03/26/connecting-an-hyper-v-virtual-machine-to-the-internet-through-a-wireless-connection/</guid>
		<description><![CDATA[In a previous post I wrote about how to configure your laptop to act alternatively as a virtualization server or as a nearly-standard desktop. Why would you do that? Well, if you need to use 64 bits virtual machines on top of Microsoft’s virtualization solutions, your only choice is to run Windows Server 2008 or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=221&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://fernandomachadopirizen.wordpress.com/2011/02/12/developing-sharepoint-2010-solutions-in-your-laptop-using-windows-server-2008-r2-with-hyper-v/" target="_blank">previous post</a> I wrote about how to configure your laptop to act alternatively as a virtualization server or as a nearly-standard desktop. Why would you do that? Well, if you need to use 64 bits virtual machines on top of Microsoft’s virtualization solutions, your only choice is to run Windows Server 2008 or Windows Server 2008 R2 with Hyper-V. For example, if you need to have different SharePoint 2010 developing environment configurations on the same machine, you will need to use 64 bits virtual machines.</p>
<p>In that post I shown how to configure an hypervisor server operating system –specifically Windows Server 2008 R2 with Hyper-V– to behave almost the same as desktop operating system –let us say Windows 7–, by enabling the features that ship disabled by default: wireless networking, audio, Aero, hibernation, and so on. Even better, since you probably want to switch between the hypervisor server scenario back and forth to the desktop scenario, I included some scripts files to enable required services and disable non-needed ones in each one case.</p>
<p>Even if you can successfully run both 32 bits and 64 bits virtual machines on your laptop when Hyper-V is properly configured, provided you have the appropriate hardware resources, you will realize sooner or later that Hyper-V is designed to run on a physical server, not on a laptop. Let me give you an example: Why do you use a laptop, after all? For mobile computing, don’t you? Well, if you do mobile computing with your laptop, you will be connected wirelessly, at least occasionally. Then you will realize you cannot connect your virtual machines to the Internet by using a wireless connection: Hyper-V only shows Ethernet network adapters when creating external virtual connections.</p>
<p>The two workarounds I found in the Internet –<a href="http://blogs.msdn.com/b/virtual_pc_guy/archive/2008/01/09/using-hyper-v-with-a-wireless-network-adapter.aspxhttp:/blogs.msdn.com/b/virtual_pc_guy/archive/2008/01/09/using-hyper-v-with-a-wireless-network-adapter.aspx">configuring Internet Connection Sharing</a> or <a href="http://sqlblog.com/blogs/john_paul_cook/archive/2008/03/23/using-wireless-with-hyper-v.aspx">using Routing and Remote Access Service</a>– were useless for me because ICS is disabled by my administrator and RRAS is too much complicated to setup.</p>
<p>I have two network interface cards in my laptop, an Intel® 82567LM-3 Gigabit Network Connection, and an Intel® Centrino® Ultimate-N 6300 AGN:</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2011/03/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2011/03/image_thumb1.png?w=644&#038;h=290" border="0" alt="image" width="644" height="290" /></a></p>
<p>But only the first one is available in the list of network cards to be used when creating an external virtual connection:</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2011/03/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2011/03/image_thumb2.png?w=644&#038;h=299" border="0" alt="image" width="644" height="299" /></a></p>
<p>There is an easy way to workaround this, and get an external virtual network connected with a wireless connection:</p>
<ol>
<li>Configure an external virtual connection using your wired local area connection as usual. Your virtual machines use this connection when you are connected by wire to access the Internet.</li>
<li>When you are not connected by wire, bridge your wireless connection with the external virtual connection, by selecting both connections in the <strong>Network Connections</strong> window, right clicking, and choosing <strong>Bridge Connections</strong> from the context menu.</li>
</ol>
<p>Your will see an additional network connection named <strong>Network Bridge</strong> and you will be able to access the Internet from your virtual machine guests through the wireless connection. Delete the bridged connection when you get connected by wire again.</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2011/03/image3.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2011/03/image_thumb3.png?w=644&#038;h=207" border="0" alt="image" width="644" height="207" /></a></p>
<p>Since you probably do not need to be permanently connected to the Internet, but want to access your host’s files and folders, I usually configure an internal virtual connection in addition to the external one, and all my virtual machines have two virtual network adapters connected to each of them.</p>
<p>If you are in the same scenario than me, I hope this tip simplifies your life. Cheers.</p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/sharepoint-2010/'>SharePoint 2010</a> Tagged: <a href='http://fernandomachadopirizen.wordpress.com/tag/hyper-vwindows-server/'>Hyper-V;Windows Server</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=221&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2011/03/26/connecting-an-hyper-v-virtual-machine-to-the-internet-through-a-wireless-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2011/03/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2011/03/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2011/03/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>New release of Visual Studio 2010 and .NET Framework 4 Training Kit</title>
		<link>http://fernandomachadopirizen.wordpress.com/2011/03/15/new-release-of-visual-studio-2010-and-net-framework-4-training-kit/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2011/03/15/new-release-of-visual-studio-2010-and-net-framework-4-training-kit/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 22:15:05 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[.NET Framework 4.0]]></category>
		<category><![CDATA[Announcements]]></category>
		<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2011/03/15/new-release-of-visual-studio-2010-and-net-framework-4-training-kit/</guid>
		<description><![CDATA[Microsoft yesterday published for download the March 2011 release of the Visual Studio 2010 and .NET Framework 4 Training Kit. You can download the kit from here. This training kit includes presentations, hands-on labs, and demos, covering the latest topics in the recently updated versions of Visual Studio 2010 and .NET Framework 4. Enjoy. &#160; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=202&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://fernandomachadopirizen.files.wordpress.com/2011/03/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border-width:0;margin:0 10px 0 0;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2011/03/image_thumb.png?w=178&#038;h=244" border="0" alt="image" width="178" height="244" align="left" /></a>Microsoft yesterday published for download the March 2011 release of the Visual Studio 2010 and .NET Framework 4 Training Kit. You can download the kit from <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=752CB725-969B-4732-A383-ED5740F02E93&amp;displaylang=en" target="_blank">here</a>. This training kit includes presentations, hands-on labs, and demos, covering the latest topics in the recently updated versions of Visual Studio 2010 and .NET Framework 4. Enjoy.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/net-framework-4-0/'>.NET Framework 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/announcements/'>Announcements</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=202&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2011/03/15/new-release-of-visual-studio-2010-and-net-framework-4-training-kit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2011/03/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio 2010 Service Pack 1 Released</title>
		<link>http://fernandomachadopirizen.wordpress.com/2011/03/10/liberado-visual-studio-2010-service-pack-1/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2011/03/10/liberado-visual-studio-2010-service-pack-1/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 10:08:02 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[.NET Framework 4.0]]></category>
		<category><![CDATA[Announcements]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2011/03/10/liberado-visual-studio-2010-service-pack-1/</guid>
		<description><![CDATA[The final version of the Visual Studio 2010 Server Pack 1 is available since yesterday for MSDN susbscribers. The list of new features and fixes is available here. Among the most interesting new features for me are: Silverlight 4 compatibility Unit testing support for .NET Framework 3.5 targets IntelliTrace for 64 bits and SharePoint applications [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=199&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The final version of the Visual Studio 2010 Server Pack 1 is available since yesterday for MSDN susbscribers. The list of new features and fixes is available <a href="http://support.microsoft.com/kb/983509/en-us" target="_blank">here</a>.</p>
<p>Among the most interesting new features for me are:</p>
<ul>
<li>Silverlight 4 compatibility</li>
<li>Unit testing support for .NET Framework 3.5 targets</li>
<li>IntelliTrace for 64 bits and SharePoint applications</li>
<li>Web applications and web project hosting on Internet Information Services (IIS) 7.5 Express </li>
<li>Microsoft Web Platform Installer support</li>
</ul>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/net-framework-4-0/'>.NET Framework 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/announcements/'>Announcements</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/sharepoint-2010/'>SharePoint 2010</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=199&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2011/03/10/liberado-visual-studio-2010-service-pack-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>
	</item>
		<item>
		<title>Developing SharePoint 2010 solutions in your laptop using Windows Server 2008 R2 with Hyper-V</title>
		<link>http://fernandomachadopirizen.wordpress.com/2011/02/12/developing-sharepoint-2010-solutions-in-your-laptop-using-windows-server-2008-r2-with-hyper-v/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2011/02/12/developing-sharepoint-2010-solutions-in-your-laptop-using-windows-server-2008-r2-with-hyper-v/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 12:13:23 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/?p=194</guid>
		<description><![CDATA[If you usually develop SharePoint Server 2010 solutions from your office desktop, it is very likely that you have a full sized server there, with all required servers and tools installed on it, or better yet if you use different server versions or configurations, you have multiple virtual machines, each one with all required software [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=194&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you usually develop SharePoint Server 2010 solutions from your office desktop, it is very likely that you have a full sized server there, with all required servers and tools installed on it, or better yet if you use different server versions or configurations, you have multiple virtual machines, each one with all required software installed on it. In such case, this blog post is not for you.</p>
<p>If your scenario is different, as mine is, and you work from different places using a laptop, and need to have different SharePoint Server 2010 installations (different versions, different languages, etc.), then you need your servers and tools running on virtual machines.</p>
<p>With Microsoft Office SharePoint Server 2007, both your host and your guest operating systems could be 32 bits, since you were able to use the 32 bits version of SharePoint servers. In addition, it was possible to use a client (non-server) operating system as host, by using Microsoft Virtual PC 2007 for example. With SharePoint Server 2010 that is not true anymore and the guest operating system needs to be a 64 bits one, let us say Windows Server 2008 R2 64 bits. This is because SharePoint Server 2010 only runs on top of 64 bits operating system.</p>
<p>You cannot have any 64 bits operating system on a virtual machine by using Microsoft Virtual PC 2007 or the new Windows 7’s Windows Virtual PC; the only way you can virtualize a 64 bits operating system is by using a hypervisor: Windows Server 2008 with the Hyper-V role.</p>
<p>Does it look a bit odd to run a hypervisor on a laptop, does not? Well, probably you are right, but you will get accustomed to it, believe me.</p>
<p>What do you lose by using Windows Server 2008 with Hyper-V as the host operating system of your laptop? If you use the default installation, you do not have:</p>
<ul>
<li><strong>Audio</strong> and <strong>Windows Media Player</strong>. The Windows Audio service is disabled by default and the Windows Media Player is not installed in a server. Usually there is nobody listening music at the servers room, it is a very noisy environment.</li>
<li><strong>Wi-Fi connectivity</strong>. The Wireless LAN Service feature is not installed. Usually servers a wired-connected to the network.</li>
<li><strong>Aero</strong>. The Themes service is disabled by default to preserve server’s resources.</li>
<li><strong>Search</strong>. The Windows Search service is disabled by default also to preserve server’s resources.</li>
<li><strong>Sleep </strong>and <strong>hibernate</strong>. Usually servers are always on and never sleep or hibernate, even turn off.</li>
<li><strong>Event Tracker</strong>. You cannot shut down the system without explaining the reason why first.</li>
<li><strong>Internet Explorer’s Enhanced Security</strong>. Every time you try to visit a website you get a message saying why you should not browse the web from a server.</li>
</ul>
<p>But what is reasonable in a server, is not reasonable in the laptop you use for your everyday work, right? You want to hear music, you need wireless connections, you need to search for files and email messages, you love the look and feel of Aero, and you do not carry your laptop with the hard disk drive spinning every time you move from one place to another.</p>
<p>Except for sleeping and hibernating, you can have audio, wireless connectivity, file and email search, and a desktop look and feel in Windows Server 2008 R2. Unfortunately, as soon as you add the Hyper‑V role, you lose the ability to sleep/hibernate your laptop. But news are no so bad, you will be able to sleep/hibernate your laptop by temporarily disabling the hypervisor without removing it.</p>
<p>In this blog post I will show you how to tweak a default Windows Server 2008 R2 installation so it looks and behaves like a Windows 7 desktop. This is how mine looks:</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2011/02/ws2008r2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0 5px;" title="WS2008R2" src="http://fernandomachadopirizen.files.wordpress.com/2011/02/ws2008r2_thumb.png?w=644&#038;h=484" border="0" alt="WS2008R2" width="644" height="484" /></a></p>
<p><strong>Enabling audio</strong></p>
<p>This one is easy. Simply click the <strong>Start</strong> button and type “services” in the search box and then open the <strong>Services</strong> console. Look for the <strong>Windows Audio</strong> service, right click and choose <strong>Properties</strong>, then in the Properties dialog box change the <strong>Start type</strong> from <strong>Disabled</strong> to <strong>Automatic</strong>.</p>
<p>Or open an administrative <strong>Command Prompt</strong> and type <strong>sc \\[machine] config audiosrv start= auto</strong> replacing [machine] for your computer’s name and then type <strong>net start audiosrv</strong>.</p>
<p><strong>Enabling Wi-Fi, Aero and Search</strong></p>
<p>Install the missing features. Click the <strong>Start</strong> button and type “server” in the search box and then open the <strong>Server Manager</strong> console. On the left panel click on <strong>Features</strong>, then click on the <strong>Add Features</strong> link on the right panel. In the Add Features Wizard select and install the features <strong>Desktop Experience</strong> and <strong>Wireless LAN Service</strong>.</p>
<p>Once these features are installed, open the <strong>Services</strong> console again and look for the <strong>Themes</strong> service, right click and choose <strong>Properties</strong>, then in the Properties dialog box change the <strong>Start type</strong> from <strong>Disabled</strong> to <strong>Automatic</strong>. Do the same with the <strong>Desktop Window Manager Session Manager</strong> service. Do the same also with the <strong>Windows Search</strong> service but set <strong>Start type</strong> to <strong>Automatic (Delayed start)</strong>.</p>
<p>Or open an administrative <strong>Command Prompt</strong> and type <strong>for %%s in (uxsms themes) do (sc \\[machine] config %%s start= auto)</strong> and then <strong>sc \\[machine] config wsearch start= auto</strong> and finally <strong>for %%s in (uxsms themes wsearch) do (net start %%s)</strong>.</p>
<p><strong>Enabling sleep/hibernate</strong></p>
<p>Let us assume you have installed Windows Server 2008 R2 and then you added the Hyper-V role. If you open an administrative <strong>Command Prompt</strong> and then you run the <strong>bcdedit</strong><strong> /enum {current}</strong> you will get an output like this one:</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2011/02/clip_image003.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0 5px;" title="clip_image003" src="http://fernandomachadopirizen.files.wordpress.com/2011/02/clip_image003_thumb.png?w=460&#038;h=191" border="0" alt="clip_image003" width="460" height="191" /></a></p>
<p><strong>bcdedit</strong> is not a “binary coded decimal” editor, as you might probably guess, but a “boot configuration datastore” editor. Note the <strong>hypervisorlaunchtype</strong> set to <strong>Auto</strong> in the last line. Also note the <strong>Windows Server 2008 R2</strong> description; this is the text you see during boot when multiple boot configurations are available or during system recovery.</p>
<p>Copy this boot configuration to a new one by typing <strong>bcdedit /copy {current} /d &#8220;Microsoft Windows Server 2008 R2 (w/o Hyper-V)&#8221;</strong> in an administrative <strong>Command Prompt</strong>. The text between the quotes is the description of the new boot configuration. You can choose a description different than mine.<strong></strong></p>
<p>The command outputs a message including a GUID of the new boot configuration. Disable the hypervisor role in the new boot configuration by using <strong>bcdedit /set {GUID} hypervisorlaunchtype off</strong> where GUID is the GUID shown by the previous command.</p>
<p>You are done. Additionally, if you want to change your default boot configuration, or change the time to display the list of configurations during boot, you can use <strong>bcdedit</strong> or the <strong>Startup and Recovery</strong> dialog box in the <strong>System Properties</strong>.</p>
<p>This new boot configuration will disable Hyper-V and let you enable sleep/hibernation, but (obviously) you will need to reboot your laptop before that. This is by far more efficient than completely removing the Hyper-V role, which by the way, also requires a reboot.</p>
<p>To enable hibernation after reboot, you will need to open an administrative <strong>Command Prompt</strong> and run <strong>powercfg –H</strong> (uppercase haitch).</p>
<p><strong>Disabling Event Tracking</strong></p>
<p>Open the <strong>Local Group Policy Editor</strong> by clicking on <strong>Start</strong> and typing “edit policy” in the search box. Then expand <strong>Local Computer Policy</strong> in the left pane, then <strong>Computer Configuration</strong>, then <strong>Administrative Templates</strong>, finally <strong>System</strong>. In the right pane look for <strong>Display Shutdown Event Tracker</strong>, double click it to edit its configuration, and choose <strong>Disable</strong>.</p>
<p><strong>Disabling Internet Explorer Enhanced Security</strong></p>
<p>Click the <strong>Start</strong> button and then type “server” in the search box and then open the <strong>Server Manager</strong> console. Select the root node in the left tree and then click on the <strong>Configure IE ESC</strong> link in the right pane. Choose <strong>Off</strong> to disable the setting.</p>
<p><strong>Final remarks</strong></p>
<p>Now you can use your laptop in two scenarios: as a hypervisor or as a regular laptop. In the first scenario, is highly recommended that you disable back services like Windows Audio, Themes, Windows Search, etc. and turn Aero themes off, in order to preserve system resources. In addition, if you have other servers like SQL Server or even a SharePoint server installed on top of your host operating system, it is highly recommended to turn them off while using the hypervisor.</p>
<p>Since you need to shut down the system before moving your laptop while using the hypervisor, and since you need to reboot to switch from one scenario to the other, consider buying a solid state disk drive for your system partition to speed up shut down and start up times. By the way, with a disk like that, turning your laptop off and on could be even faster than hibernating and restoring from a regular hard disk drive, if your laptop has a lot of RAM, as it should have to use eventually multiple virtual machines simultaneously.</p>
<p>To facilitate switching from the hypervisor scenario to the regular laptop scenario, you can use the following batch files and scripts.</p>
<p>Use this batch file to enable or disable search by simply typing <strong>search on</strong> or <strong>search off</strong> in an administrative <strong>Command Prompt</strong>. This batch file not only stops or starts the search service; it also enables or disables it, so the current status is kept after rebooting.</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:ee9ae1b2-6f82-4524-9c72-fcb9bc99eb7a" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: plain; auto-links: false; gutter: false; light: false; pad-line-numbers: true; toolbar: false;">
@echo off

rem Enables and starts or stops and disables search services

rem Search services:
rem	Windows Search

set x=%1%#
if %x%==# goto usage
if %1%==on goto enable
if %1%==off goto disable

:usage

echo &quot;Usage: search on|off&quot;
goto end

:enable

rem Enables desktop services

for %%s in (wsearch) do (sc \\[machine] config %%s start= delayed-auto)
for %%s in (wsearch) do (net start %%s)

pause
goto end

:disable

rem Disables search services

for %%s in (wsearch) do (net stop %%s)
for %%s in (wsearch) do (sc \\[machine] config %%s start= disabled)

pause
goto end

:end
</pre>
</div>
<p> </p>
<p>You can use this other batch file to enable or disable the audio related services, by typing <strong>audio on</strong> or <strong>audio off</strong> in an administrative <strong>Command Prompt</strong>.</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:1b83c1fb-de81-4b53-861f-33a01a2f03ee" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: plain; auto-links: false; gutter: false; toolbar: false;">
@echo off

rem Enables and starts or stops and disables audio related services

rem Audio services:
rem	Windows Audio
rem	Windows Audio Endpoint Builder

set x=%1%#
if %x%==# goto usage
if %1%==on goto enable
if %1%==off goto disable

:usage

echo &quot;Usage: audio on|off&quot;
goto end

:enable

rem Enables audio services

for %%s in (audiosrv audioendpointbuilder) do (sc \\[machine] config %%s start= auto)
for %%s in (audiosrv audioendpointbuilder) do (net start %%s)

pause
goto end

:disable

rem Disables audio services

for %%s in (audiosrv audioendpointbuilder) do (net stop %%s)
for %%s in (audiosrv audioendpointbuilder) do (sc \\[machine] config %%s start= disabled)

pause
goto end

:end
</pre>
</div>
<p> </p>
<p>To stop all servers’ services, there is another batch file you can use to stop and disable or start and enable these services, by typing <strong>servermode off</strong> or <strong>server mode on</strong> on an administrative <strong>Command Prompt</strong>.</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:d019f55c-15bb-4e45-8c3b-72557c91f59d" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: plain; auto-links: false; gutter: false; toolbar: false;">
@echo off

rem Enables and starts or stops and disables server related services

rem Server services:
rem	Application Host Helper Service
rem	Distributed Transaction Coordinator
rem	Simple Mail Transfer Protocol (SMTP)
rem	IIS Admin Service
rem	Net.Msmq Listener Adapter (depends on Message Queuing)
rem	Message Queuing
rem	SharePoint 2010 Timer
rem	SharePoint 2010 Tracing
rem	SharePoint 2010 User Code Host
rem	SharePoint Foundation Search V4
rem	SharePoint Server Search 14
rem	SQL Full-text Filter Daemon Launcher (MSSQLSERVER)
rem	SQL Server Agent (MSSQLSERVER) (depends on SQL Server (MSSQLSERVER))
rem	SQL Server (MSSQLSERVER)
rem	SQL Server (SHAREPOINT)
rem	SQL Server (SQLEXPRESS)
rem	SQL Server Analysis Services (MSSQLSERVER)
rem	SQL Server Browser
rem	SQL Server Integration Services 10.0
rem	SQL Server Reporting Services (MSSQLSERVER)
rem	SQL Server VSS Writer
rem	Visual Studio Team Foundation Background Job Agent
rem	Visual Studio Team Foundation Build Service Host
rem	World Wide Web Publishing Service

set x=%1%#
if %x%==# goto usage
if %1%==off goto disable
if %1%==on goto enable

:usage

echo &quot;Usage: servermode on|off&quot;
goto end

:disable

rem Disables server services

for %%s in (apphostsvc SMTPSVC msdtc iisadmin NetMsmqActivator msmq sptimerv4 sptracev4 spusercodev4 spsearch4 osearch14 SQLSERVERAGENT MSSQLSERVER MSSQL$SHAREPOINT MSSQL$SQLEXPRESS MSSQLServerOLAPService SQLBrowser MsDtsServer100 ReportServer SQLWriter TFSJobAgent TFSBuildServiceHost W3SVC) do (net stop %%s)
for %%s in (apphostsvc msdtc SMTPSVC iisadmin NetMsmqActivator msmq sptimerv4 sptracev4 spusercodev4 spsearch4 osearch14 MSSQLFDLauncher SQLSERVERAGENT MSSQLSERVER MSSQL$SHAREPOINT MSSQL$SQLEXPRESS MSSQLServerOLAPService SQLBrowser MsDtsServer100 ReportServer SQLWriter TFSJobAgent TFSBuildServiceHost W3SVC) do (sc \\[machine] config %%s start= disabled)

pause
goto end

:enable

rem Enables server services

for %%s in (apphostsvc msdtc iisadmin NetMsmqActivator msmq sptimerv4 sptracev4 spusercodev4 MSSQLFDLauncher SQLSERVERAGENT MSSQLSERVER MSSQL$SHAREPOINT MSSQL$SQLEXPRESS MSSQLServerOLAPService SQLBrowser MsDtsServer100 ReportServer SQLWriter TFSJobAgent TFSBuildServiceHost W3SVC) do (sc \\[machine] config %%s start= auto)
for %%s in (msdtc) do (sc \\[machine] config %%s start= delayed-auto)
for %%s in (spsearch4 osearch14 MSSQLFDLauncher SMTPSVC) do (sc \\[machine] config %%s start= demand)
for %%s in (apphostsvc msdtc iisadmin NetMsmqActivator msmq sptimerv4 sptracev4 spusercodev4 spsearch4 osearch14 MSSQLFDLauncher SQLSERVERAGENT MSSQLSERVER MSSQL$SHAREPOINT MSSQL$SQLEXPRESS MSSQLServerOLAPService SQLBrowser MsDtsServer100 ReportServer SQLWriter TFSJobAgent TFSBuildServiceHost W3SVC SMTPSVC) do (net start %%s)

pause
goto end

:end
</pre>
</div>
<p> </p>
<p>Since hypervisor’s services are needed only when you boot using the hypervisor configuration, these services are enabled or disabled on a separate batch file.</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:118b0d53-3b59-4875-b757-297600f04c48" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: plain; auto-links: false; gutter: false; toolbar: false;">
@echo off

rem Starts or stops Hyper-V related services

if %1%==off goto disable
if %1%==on goto enable
goto end

:disable

for %%s in (vhdsvc nvspwmi vmms hvboot) do (net stop %%s)
for %%s in (vhdsvc nvspwmi vmms hvboot) do (sc \\[machine] config %%s start= disabled)
pause
goto end

:enable

for %%s in (vhdsvc nvspwmi vmms) do (sc \\[machine] config %%s start= auto)
for %%s in (hvboot) do (sc \\[machine] config %%s start= demand)
for %%s in (vhdsvc nvspwmi vmms hvboot) do (net start %%s)
pause
goto end

:end
</pre>
</div>
<p> </p>
<p>Since I do a lot of work with many different servers (SQL Server, SharePoint Server, Team Foundation Server, etc.), the list of services I have in this batch file is big. You can remove or add your own services from the batch file. If you plan to modify it, pay attention to the following:</p>
<p>1. Dependencies. You need to stop a services after all the services that depends on it, to avoid confirmation messages stopping your batch file processing. Make sure your start them in the reverse order.</p>
<p>2. Start type. Disabling services is easy: there is just one disabled status. But enabling them is a bit more complicated, because there is more than one start type: automatic, automatic but delayed, and manual. Make sure you return the start type to the original one.</p>
<p>The extra mile: if you want your Windows Server 2008 R2 installation to look exactly (well, very similar at least) than a Windows 7 desktop, with Aero and themes, you can use these additional batch files and scripts. You bet it, there are <strong>desktopmode on</strong> and <strong>desktopmode off</strong> commands to do this.</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:71ace3fe-812e-43c1-8280-11912cd979fa" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: plain; auto-links: false; gutter: false; toolbar: false;">
@echo off

rem Enables and starts or stops and disables desktop related services

rem Desktop services:
rem	Windows Audio
rem	Windows Audio Endpoint Builder
rem	Windows Search
rem	Desktop Window Manager Session Manager
rem	Disk Defragmenter (stop only)
rem	Themes

set x=%1%#
if %x%==# goto usage
if %1%==on goto enable
if %1%==off goto disable

:usage

echo &quot;Usage: desktopmode on|off&quot;
goto end

:enable

rem Enables desktop services

for %%s in (audiosrv audioendpointbuilder uxsms defragsvc themes) do (sc \\[machine] config %%s start= auto)
for %%s in (wsearch) do (sc \\[machine] config %%s start= delayed-auto)
for %%s in (defragsvc) do (sc \\[machine] config %%s start= demand)
for %%s in (audiosrv audioendpointbuilder wsearch uxsms themes) do (net start %%s)
DesktopTheme.vbs

pause
goto end

:disable

rem Disables desktop services

for %%s in (audiosrv audioendpointbuilder wsearch uxsms defragsvc themes) do (net stop %%s)
for %%s in (audiosrv audioendpointbuilder wsearch uxsms defragsvc themes) do (sc \\[machine] config %%s start= disabled)
ServerTheme.vbs

pause
goto end

:end
</pre>
</div>
<p> </p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:3ace23b3-eb16-4cfa-8a0e-12c10605046a" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: vb; auto-links: false; gutter: false; toolbar: false;">
Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)

WshShell.Run &quot;rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:&quot;&quot;C:\Windows\Resources\Themes\aero.theme&quot;&quot;&quot;

Wscript.Sleep 15000
WshShell.AppActivate(&quot;Desktop Properties&quot;)
WshShell.Sendkeys &quot;%FC&quot;
WshShell.Sendkeys &quot;{F4}&quot;
</pre>
</div>
<p> </p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:8845c113-e4bb-4a5b-9d0a-3041d02f3f81" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: vb; auto-links: false; gutter: false; toolbar: false;">
Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)

WshShell.Run &quot;rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:&quot;&quot;C:\Windows\Resources\Ease of Access Themes\classic.theme&quot;&quot;&quot;

Wscript.Sleep 1000
WshShell.AppActivate(&quot;Desktop Properties&quot;)
WshShell.Sendkeys &quot;%FC&quot;
WshShell.Sendkeys &quot;{F4}&quot;
</pre>
</div>
<p> </p>
<p>One final recommendation: add the folder where this batch files and scripts are stored to the <strong>PATH</strong> environment variable.</p>
<p>Have fun.</p>
<p>PS: In order to be completely honest, there are other things you will lose if you choose to install Windows Server 2008 R2 in your laptop. First, the Bluetooth drivers are usually not available for server operating systems, so be aware if you depend on Bluetooth devices for your daily work. Second, depending on your system’s hardware, other device drivers might not be available for server operating systems. The most common ones are the fingerprint reader and the smart card reader drivers. You can try installing the drivers for Windows 7, but this may or may not work. Finally, some third party tools detect a non-desktop operating system and refuse to run or even to install. So far, I can live with all these limitations, but you cannot say I did not tell you.</p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/sharepoint-2010/'>SharePoint 2010</a> Tagged: <a href='http://fernandomachadopirizen.wordpress.com/tag/sharepoint/'>SharePoint</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/windows-server-2008-r2/'>Windows Server 2008 R2</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=194&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2011/02/12/developing-sharepoint-2010-solutions-in-your-laptop-using-windows-server-2008-r2-with-hyper-v/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2011/02/ws2008r2_thumb.png" medium="image">
			<media:title type="html">WS2008R2</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2011/02/clip_image003_thumb.png" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>
	</item>
		<item>
		<title>First look to the Microsoft Visual Studio LightSwitch beta</title>
		<link>http://fernandomachadopirizen.wordpress.com/2010/08/20/first-look-to-the-microsoft-visual-studio-lightswitch-beta/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2010/08/20/first-look-to-the-microsoft-visual-studio-lightswitch-beta/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 00:50:25 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2010/08/20/primera-beta-de-microsoft-visual-studio-lightswitch/</guid>
		<description><![CDATA[A new member of the developers’ tools family has been announced earlier this month and the first beta will be available soon for download: Microsoft Visual Studio LightSwitch. What it is and what it is for? With LightSwitch we can easily and quickly create business applications from the scratch, including not only the application user [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=186&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A new member of the developers’ tools family has been announced earlier this month and the first beta will be available soon for download: <a href="http://www.microsoft.com/lightswitch" target="_blank">Microsoft Visual Studio LightSwitch</a>.</p>
<p>What it is and what it is for?</p>
<p>With <strong>LightSwitch</strong> we can easily and quickly create business applications from the scratch, including not only the application user interface forms, but also the application database; you can also create applications from existing databases.</p>
<p>In this article I will provide an overview of <strong>LightSwitch</strong> using the beta version soon to be available. The project I will create is a simple application to record the books I loan to my friends.</p>
<p>A new <strong>LightSwitch</strong> application starts by creating a new Visual Studio project. A <strong>LightSwitch</strong> project will contain application’s data and forms definitions. By using these definitions <strong>LightSwitch</strong> generates a SQL Server database and the source code in C# or Visual Basic.</p>
<p>In this article I will use a C# project template. Here you can see the familiar Visual Studio new project dialog box, with the two templates provided by <strong>LightSwitch</strong>.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS1.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image.png?w=628&#038;h=435" border="0" alt="image" width="628" height="435" /></a></p>
<p>Once the project is created we can connect to an existing data source or create a new data definition for the application. In this post I will show how to create data definitions from the scratch.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS2.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image1.png?w=628&#038;h=464" border="0" alt="image" width="628" height="464" /></a></p>
<p>The first thing to do is to define how book entities are. I am interested in each book’s author and title. Then we create an entity <strong>Book</strong>, with <strong>Author</strong> and <strong>Title</strong> fields, both of type <strong>String</strong> and both required. These entities will be stored in a <strong>Books</strong> table.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS3.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image2.png?w=632&#038;h=468" border="0" alt="image" width="632" height="468" /></a></p>
<p>Then a definition for loans is created. From each loan I am interested in knowing to whom I loaned the book, when the book was loaned, and when it was returned. Then we create a second entity called <strong>Loan</strong>, with fields <strong>ToFriend</strong>, <strong>DateLoaned</strong> and <strong>DateReturned</strong>; the first field is of type <strong>String</strong> and the two other are of type <strong>Date</strong>; the first two fields are required, but the latest is not. These entities will be stored in the <strong>Loans</strong> table.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS4.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image3.png?w=631&#038;h=468" border="0" alt="image" width="631" height="468" /></a></p>
<p>Now a new relationship between books and loans is defined.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS5.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image4.png?w=379&#038;h=410" border="0" alt="image" width="379" height="410" /></a></p>
<p>See below how the definition of the entity <strong>Loan</strong> and its relationship with <strong>Book</strong> looks:</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS6.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image5.png?w=632&#038;h=468" border="0" alt="image" width="632" height="468" /></a></p>
<p>Now we need to define the forms to edit these entities. Many different form templates are available -allowing one record to be edited at a time, multiple records in a grid, etc. I will use a template for a simple record insertion.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS6.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image6.png?w=636&#038;h=459" border="0" alt="image" width="636" height="459" /></a></p>
<p>The form definition created by the wizard can be modified. I have changed only the name to display and the description of the form.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS8.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image7.png?w=636&#038;h=472" border="0" alt="image" width="636" height="472" /></a></p>
<p>Once the form definition is finished, we can test the application. This <strong>LightSwitch</strong> version allows creating the following application types:</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS9.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image8.png?w=636&#038;h=474" border="0" alt="image" width="636" height="474" /></a></p>
<p>When the build is started <strong>LightSwitch</strong>:</p>
<ul>
<li>Creates the database</li>
<li>Generates the source code</li>
<li>Compiles the application</li>
</ul>
<p>A <strong>LightSwitch</strong> application is typically a three tier application, using certain specific technologies for each tier:</p>
<ul>
<li>The presentation tier, responsible for data manipulation and presentation to the user, is a <a href="http://www.silverlight.net/" target="_blank">Silverlight 4.0</a> application.</li>
<li>The business logic tier, responsible for queries, updates, validation and processing of data, exposes a set of <a href="http://msdn.microsoft.com/en-us/library/ee707344(VS.91).aspx" target="_blank">WCF RIA Domain Services</a> running on an <a href="http://www.asp.net/" target="_blank">ASP.NET 4.0</a> in an <a href="http://www.iis.net/" target="_blank">IIS</a> or a <a href="http://msdn.microsoft.com/en-us/windowsazure/default.aspx" target="_blank">Windows Azure</a> <em>web role</em>.</li>
<li>The data tier, responsible for data storage, uses <a href="http://msdn.microsoft.com/en-us/sqlserver/default.aspx" target="_blank">SQL Server</a> or <a href="http://msdn.microsoft.com/en-us/windowsazure/sqlazure/default.aspx" target="_blank">SQL Azure</a>.</li>
</ul>
<p>In <a href="http://blogs.msdn.com/b/lightswitch/archive/2010/08/06/the-anatomy-of-a-lightswitch-application-overview.aspx" target="_blank">this article</a> you can find more information about the architecture of a <strong>LightSwitch</strong> application.</p>
<p>When a <strong>LightSwitch</strong> application gets executed:</p>
<ul>
<li>A local web server is started</li>
<li>The application is deployed on this web server</li>
<li>The application is started</li>
</ul>
<p>That is what we see:</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS10.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image9.png?w=640&#038;h=505" border="0" alt="image" width="640" height="505" /></a></p>
<p>Let us complete the fields to add the first book:</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS11.png"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image10.png?w=636&#038;h=501" border="0" alt="image" width="636" height="501" /></a></p>
<p>The application automatically assigns a new identifier to the first book.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS12.png"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image11.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p>Out of the box, the application already has some simple validations, like the one corresponding to the fields marked as required.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS13.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image12.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS14.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image13.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS15.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image14.png?w=636&#038;h=501" border="0" alt="image" width="636" height="501" /></a></p>
<p>The second form is to insert loans. This is also a simple new record form. We can see how <strong>LightSwitch</strong> assigns a <strong>Date Picker</strong> control to the <strong>DateLoaned</strong> and <strong>DateReturned</strong> fields, of type <strong>Date</strong>. It also assigned a <strong>Modal Window Picker</strong> control to edit the association between a <strong>Loan</strong> and a <strong>Book</strong>.</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2010/08/image15.png"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image_thumb.png?w=628&#038;h=464" border="0" alt="image" width="628" height="464" /></a></p>
<p>When we run the application we can see how the controls assigned to <strong>Date</strong> fields looks:</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS16.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image16.png?w=636&#038;h=501" border="0" alt="image" width="636" height="501" /></a></p>
<p>The <strong>Modal Window Picker</strong> control allows searching and selecting a book to be associated with a loan. The control includes not only the search features, but also allows paging results.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS17.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image17.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p>Although this way to edit loans is not so bad, I would prefer to see the list of books, and from there to easily access each book’s loans, and eventually adding new books in the same place. The template for this kind of editing form is called <strong>List and Details Screen</strong>. Look how <strong>LightSwitch</strong> allows indicating if books’ and loans’ details should be included on the form.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS18.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image18.png?w=632&#038;h=455" border="0" alt="image" width="632" height="455" /></a></p>
<p>Once the form is created, we can edit its definition. Like in previous cases, I only slightly change the name to display and add a description.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS19.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image19.png?w=632&#038;h=468" border="0" alt="image" width="632" height="468" /></a></p>
<p>We can see how the new form looks when running the application. The list of books appears on the left. From there we can add, modify, and delete books. For the book selected in the list on the left, we can see the loans in the right. From there we can also add, modify, and delete loans.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS20.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image20.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p>Be aware that for adding and modifying books and loans, <strong>LightSwitch</strong> automatically generated a form with the same controls defined in their respective new record forms.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS21.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image21.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS22.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image22.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p>These forms have also the default behavior for validating the rules defined in the entities.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS23.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image23.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p>When more than one record is changed in a list, modifications are not sent to the database until the list is saved by using the <strong>Save</strong> button.</p>
<p><a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LS24.png" target="_blank"><img class="wlDisabledImage" style="display:inline;border-width:0;margin:0 5px;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/08/image24.png?w=632&#038;h=497" border="0" alt="image" width="632" height="497" /></a></p>
<p>How much time takes this application to be created? Not too much, as you can see in this video:</p>
<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:bafd9ad6-df26-4c02-a36d-e1b1533bbf4c" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<div><span style="text-align:center; display: block;"><a href="http://fernandomachadopirizen.wordpress.com/2010/08/20/first-look-to-the-microsoft-visual-studio-lightswitch-beta/"><img src="http://img.youtube.com/vi/zbpz2b0w5OE/2.jpg" alt="" /></a></span></div>
</div>
<p> </p>
<p>You can download the video <a href="http://cid-8d961b36abfd7a76.office.live.com/self.aspx/Public/LightSwitchBetaDemo^_en.zip" target="_blank">from here</a>.</p>
<p>Okay, but what kind of applications is <strong>LightSwitch</strong> for? Perhaps we need to wait for a while to see who really takes advantage of this new technology. Simple applications like the one I created in this post can be created really quickly, but we all know that real world applications are not as easy to build as the ones I have demoed, are they? For non-professional or occasional developers –for whom other technologies like Microsoft Access or Visual FoxPro was created in the past-, <strong>LightSwitch</strong> can be their new preferred tool. Professional developer will probably not be able to build 100% of the complex business applications they create today by using <strong>LightSwitch</strong>, but at least they can use <strong>LightSwitch</strong> as a tool for rapid prototyping.</p>
<p>In certain places in the application definition we can write C# code to add functions not provided by <strong>LightSwitch</strong> -for business rules for example. But then we need to know the object model of the code generated by <strong>LightSwitch</strong>, to be able to consume from our own handwritten code the types automatically generated by <strong>LightSwitch</strong>.</p>
<p>Some of the templates seem to be extensible –this beta version includes templates lists with just an element, but probably it is because it is a beta. Furthermore, it seems that <strong>LightSwitch</strong> will be able to create applications for <strong>Windows Azure</strong> also. Since all the code and the database are generated from definitions, the same application could be migrated from the desktop to the cloud just by changing a setting in the project properties page.</p>
<p>With an object model easy to be consumed in extension points and a strong ecosystem augmenting <strong>LightSwitch</strong> capabilities, it looks like we will be able to use it to develop applications more complex than the one created here. It is too soon yet, time will tell.</p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/announcements/'>Announcements</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a> Tagged: <a href='http://fernandomachadopirizen.wordpress.com/tag/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/lightswitch/'>LightSwitch</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/visual-studio-2010/'>Visual Studio 2010</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=186&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2010/08/20/first-look-to-the-microsoft-visual-studio-lightswitch-beta/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image16.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image17.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image18.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image19.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image20.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image21.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image22.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image23.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/08/image24.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Give me a handle and I will move the Earth</title>
		<link>http://fernandomachadopirizen.wordpress.com/2010/08/09/give-me-a-handle-and-i-will-move-the-earth/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2010/08/09/give-me-a-handle-and-i-will-move-the-earth/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 14:46:33 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Giving a Presentation]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2010/08/09/give-me-a-handle-and-i-will-move-the-earth/</guid>
		<description><![CDATA[This post’s title paraphrases a saying attributed to Archimedes, who is said to have remarked of lever “Give me a place to stand on, and I will move the Earth”. For people like me who started developing Windows applications a long time ago, handles were the entry door to almost any resource through Win32 API. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=157&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://fernandomachadopiriz.files.wordpress.com/2010/08/image.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;margin:0 10px 0 5px;" title="image" border="0" alt="image" align="left" src="http://fernandomachadopiriz.files.wordpress.com/2010/08/image_thumb.png?w=244&#038;h=148&#038;h=148" width="244" height="148" /></a></p>
<p>This post’s title paraphrases a saying attributed to <a href="http://en.wikipedia.org/wiki/Archimedes" target="_blank">Archimedes</a>, who is said to have remarked of lever “Give me a place to stand on, and I will move the Earth”. </p>
<p>For people like me who started developing Windows applications a long time ago, handles were the entry door to almost any resource through Win32 API. Do you want to close or minimize a window? You need that window handle. Do you want to write some text into a window client area? You need the font handle, the device context handle, and the window handle. And so on.</p>
<p>Fortunately, in actual .NET Framework times, almost no one cares about using handles, nor cares about knowing what they are. The .NET Framework hides the complexity of handling Windows resources through the Win32 API, and with that, it also hides the handles.</p>
<p>However, once in a while, there appear some problems for which the only solution is to get a handle. Here is an example.</p>
<p>One of the features of the <a href="http://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/" target="_blank">Giving a Presentation</a> demo application is the ability to hide desktop icons during a presentation, showing them back again when the presentation ends. While developing thsi feature, I unsuccessfully searched for a way to do that. As far as I could found, there is no public API function to do it; and most hacks available on the web -for example <a href="http://www.google.com.uy/url?sa=t&amp;source=web&amp;cd=1&amp;ved=0CBQQFjAA&amp;url=http%3A%2F%2Fsocial.msdn.microsoft.com%2FForums%2Fen-US%2FVsexpressvcs%2Fthread%2F16415429-8c9e-49ec-b977-f514d442435f&amp;ei=JGhfTIqhAoKB8gbXpom-DQ&amp;usg=AFQjCNHQZjf9O1-ma2hD2CxvH2G6GSpuGw" target="_blank">this one</a>- use handles and Win32 API function calls, but does not work correctly: they disable the entire desktop, not only its icons; as a consequence, the desktop’s pop up menu disappears.</p>
<p>Speaking about desktop’s popup menu, what I needed was a feature like the one in the <b>Show desktop icons</b> command.</p>
<p><a href="http://fernandomachadopiriz.files.wordpress.com/2010/08/image1.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;margin:0 5px;" title="image" border="0" alt="image" src="http://fernandomachadopiriz.files.wordpress.com/2010/08/image_thumb1.png?w=457&#038;h=251&#038;h=251" width="457" height="251" /></a></p>
<p>Then it was when the old knowledge about handles and the like became useful again. I knew that this command ended sooner or later being transformed into a <strong>WM_COMMAND</strong> sent to the desktop. What I needed to emulate this behavior was to know the arguments of the <strong>WM_COMMAND </strong>message and –as you can imagine- the desktop handle. Once I get this information, I could send the same <strong>WM_COMMAND </strong>to the desktop. The desktop would not distinguish between a message sent by the menu command or by my program, so it should handle it in the same way.</p>
<p>For both two things I used an old tool still included in Visual Studio installation: <strong>Spy++</strong>. This tool allow finding a particular window, and among other things, look at the messages it receives. The following picture show the <strong>Spy++</strong> windows list node corresponding to the desktop. Please note that desktop is a window of the <b>SHELLDLL_DefView</b> class; we will see later how this information is used.</p>
<p><a href="http://fernandomachadopiriz.files.wordpress.com/2010/08/clip_image003.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;margin:0 5px;" title="clip_image003" border="0" alt="clip_image003" src="http://fernandomachadopiriz.files.wordpress.com/2010/08/clip_image003_thumb.png?w=389&#038;h=242&#038;h=242" width="389" height="242" /></a></p>
<p>The following image shows the messages received by this window when command <b>Show desktop icons</b> is executed. Please not the command ID <b>29698</b> of the <b>WM_COMMAND</b> message; we will also see later how to use this information.</p>
<p><a href="http://fernandomachadopiriz.files.wordpress.com/2010/08/clip_image004.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;margin:0 5px;" title="clip_image004" border="0" alt="clip_image004" src="http://fernandomachadopiriz.files.wordpress.com/2010/08/clip_image004_thumb.png?w=389&#038;h=242&#038;h=242" width="389" height="242" /></a></p>
<p>The function to hide or show desktop icons finally gets something like this:</p>
<p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:05382d36-f8dc-4d98-b51a-74d47217f7a2" class="wlWriterEditableSmartContent">
<pre>
<pre class="brush: csharp; gutter: false; pad-line-numbers: true; toolbar: false;">
/// &lt;summary&gt;
/// Toggles desktop icons visibility by sending a low level command to desktop window in the same way as the popup menu &quot;Show desktop
/// icons&quot; does. Use &lt;code&gt;AreDesktopIconsVisible&lt;/code&gt; to get current desktop icons visibility status.
/// &lt;/summary&gt;
private static void ToggleDesktopIconsVisibility()
{
    IntPtr defaultViewHandle = FindShellWindow();
    UIntPtr resultArgument;
    IntPtr returnValue = NativeMethods.SendMessageTimeout(
        defaultViewHandle,
        NativeMethods.WM_COMMAND,
        new IntPtr(29698),
        IntPtr.Zero,
        NativeMethods.SendMessageTimeoutFlags.SMTO_ABORTIFHUNG,
        1000,
       out resultArgument);
}
</pre>
</pre>
</div>
<p>The <b>NativeMethods</b> class contains all the functions and constants imported from Win32 API; code is not shown here due to simplicity, but you can download it from <a href="http://givingapresentation.codeplex.com/SourceControl/changeset/view/58706#1510683" target="_blank">CodePlex</a>. The function <b>SendMessageTimeout</b> is used to send the <b>WM_COMMAND</b> with ID <strong>29698</strong> to the window whose handle was obtained with the <b>FindShellWindow</b> function.</p>
<p>On the other side, the <strong>FindShellWindow</strong> function finds and returns the desktop handle, strictlyspeaking, the handle to the window containing desktop icons, whose class is <strong>SHELLDLL_DefView</strong>. Finding this window was not easy. Due to unknown reasons, in certain systems the window is in some place in the windows’ hierarchy, but in other systems is in another place – both system being Window 7 RTM 32 bits. Because of this, the <strong>Giving a Presentation </strong>feature to hide and show desktop icons, did not work in every situations. I should thanks to my MVP coleague Elías Mereb for his help to test different candidate solutions until finding the good one.</p>
<p><div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:56375094-3ce4-418b-abbf-e0faad9769a6" class="wlWriterEditableSmartContent">
<pre>
<pre class="brush: csharp; gutter: false; toolbar: false;">
/// &lt;summary&gt;
/// Called by EnumWindows. Sets &lt;code&gt;shellWindowHandle&lt;/code&gt; if a window with class &quot;SHELLDLL_DefView&quot; is found during enumeration.
/// &lt;/summary&gt;
/// &lt;param name=&quot;handle&quot;&gt;The handle of the window being enumerated.&lt;/param&gt;
/// &lt;param name=&quot;param&quot;&gt;The argument passed to &lt;code&gt;EnumWindowsProc&lt;/code&gt;; not used in this application.&lt;/param&gt;
/// &lt;returns&gt;Allways returns 1.&lt;/returns&gt;
private static int EnumWindowsProc(IntPtr handle, int param)
{
    try
    {
        IntPtr foundHandle = NativeMethods.FindWindowEx(handle, IntPtr.Zero, &quot;SHELLDLL_DefView&quot;, null);
        if (!foundHandle.Equals(IntPtr.Zero))
        {
            shellWindowHandle = foundHandle;
            return 0;
        }
    }
    catch
    {
        // Intentionally left blank
    }

    return 1;
}

/// &lt;summary&gt;
/// Finds the window containing desktop icons.
/// &lt;/summary&gt;
/// &lt;returns&gt;The handle of the window.&lt;/returns&gt;
private static IntPtr FindShellWindow()
{
    IntPtr progmanHandle;
    IntPtr defaultViewHandle = IntPtr.Zero;
    IntPtr workerWHandle;
    int errorCode = NativeMethods.ERROR_SUCCESS;

    // Try the easy way first. &quot;SHELLDLL_DefView&quot; is a child window of &quot;Progman&quot;.
    progmanHandle = NativeMethods.FindWindowEx(IntPtr.Zero, IntPtr.Zero, &quot;Progman&quot;, null);

    if (!progmanHandle.Equals(IntPtr.Zero))
    {
        defaultViewHandle = NativeMethods.FindWindowEx(progmanHandle, IntPtr.Zero, &quot;SHELLDLL_DefView&quot;, null);
        errorCode = Marshal.GetLastWin32Error();
    }

    if (!defaultViewHandle.Equals(IntPtr.Zero))
    {
        return defaultViewHandle;
    }
    else if (errorCode != NativeMethods.ERROR_SUCCESS)
    {
        Marshal.ThrowExceptionForHR(errorCode);
    }

    // Try the not so easy way then. In some systems &quot;SHELLDLL_DefView&quot; is a child of &quot;WorkerW&quot;.
    errorCode = NativeMethods.ERROR_SUCCESS;
    workerWHandle = NativeMethods.FindWindowEx(IntPtr.Zero, IntPtr.Zero, &quot;WorkerW&quot;, null);
    Debug.WriteLine(&quot;FindShellWindow.workerWHandle: {0}&quot;, workerWHandle);

    if (!workerWHandle.Equals(IntPtr.Zero))
    {
        defaultViewHandle = NativeMethods.FindWindowEx(workerWHandle, IntPtr.Zero, &quot;SHELLDLL_DefView&quot;, null);
        errorCode = Marshal.GetLastWin32Error();
    }

    if (!defaultViewHandle.Equals(IntPtr.Zero))
    {
        return defaultViewHandle;
    }
    else if (errorCode != NativeMethods.ERROR_SUCCESS)
    {
        Marshal.ThrowExceptionForHR(errorCode);
    }

    shellWindowHandle = IntPtr.Zero;

    // Try the hard way. In some systems &quot;SHELLDLL_DefView&quot; is a child or a child of &quot;Progman&quot;.
    if (NativeMethods.EnumWindows(EnumWindowsProc, progmanHandle) == 0)
    {
        errorCode = Marshal.GetLastWin32Error();
        if (errorCode != NativeMethods.ERROR_SUCCESS)
        {
            Marshal.ThrowExceptionForHR(errorCode);
        }
    }

    // Try the even more harder way. Just in case &quot;SHELLDLL_DefView&quot; is in another desktop.
    if (shellWindowHandle.Equals(IntPtr.Zero))
    {
        if (NativeMethods.EnumDesktopWindows(IntPtr.Zero, EnumWindowsProc, progmanHandle))
        {
            errorCode = Marshal.GetLastWin32Error();
            if (errorCode != NativeMethods.ERROR_SUCCESS)
            {
                Marshal.ThrowExceptionForHR(errorCode);
            }
        }
    }

    return shellWindowHandle;
}
</pre>
</pre>
</div>
<p>In certain situations, even in the .NET Framework era, it is still useful to get a handle: give me one, and I will move the Earth. Or at least, I will hide and show desktop icons. See you later.
  </p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/c-4-0/'>C# 4.0</a> Tagged: <a href='http://fernandomachadopirizen.wordpress.com/tag/giving-a-presentation/'>Giving a Presentation</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=157&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2010/08/09/give-me-a-handle-and-i-will-move-the-earth/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>

		<media:content url="http://fernandomachadopiriz.files.wordpress.com/2010/08/image_thumb.png?w=244&#38;h=148" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopiriz.files.wordpress.com/2010/08/image_thumb1.png?w=457&#38;h=251" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopiriz.files.wordpress.com/2010/08/clip_image003_thumb.png?w=389&#38;h=242" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>

		<media:content url="http://fernandomachadopiriz.files.wordpress.com/2010/08/clip_image004_thumb.png?w=389&#38;h=242" medium="image">
			<media:title type="html">clip_image004</media:title>
		</media:content>
	</item>
		<item>
		<title>The new Visualization and Modeling Feature Pack allows generating UML diagrams from code and vice versa</title>
		<link>http://fernandomachadopirizen.wordpress.com/2010/06/16/the-new-visualization-and-modeling-feature-pack-allows-generating-uml-diagrams-from-code-and-vice-versa/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2010/06/16/the-new-visualization-and-modeling-feature-pack-allows-generating-uml-diagrams-from-code-and-vice-versa/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 21:15:28 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[Giving a Presentation]]></category>
		<category><![CDATA[UML]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2010/06/16/the-new-visualization-and-modeling-feature-pack-allows-generating-uml-diagrams-from-code-and-vice-versa/</guid>
		<description><![CDATA[Microsoft recently published the Visualization and Modeling Feature Pack for Visual Studio 2010. Download is available for MSDN subscribers here. The following (longly awaited) features are included: Generate code from UML class diagrams. Create UML class diagrams from code. Import UML class, sequence, and use case elements from XMI 2.1 files. Create and view links [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=153&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Microsoft recently published the <strong>Visualization and Modeling Feature Pack for Visual Studio 2010</strong>. Download is available for MSDN subscribers <a href="https://msdn.microsoft.com/en-us/subscriptions/securedownloads/default.aspx?pv=18:370" target="_blank">here</a>. The following (longly awaited) features are included:</p>
<ul>
<li>Generate code from UML class diagrams.</li>
<li>Create UML class diagrams from code.</li>
<li>Import UML class, sequence, and use case elements from XMI 2.1 files.</li>
<li>Create and view links from work items to model elements.</li>
<li>Generate dependency graphs for ASP.NET Web, C, and C++ projects.</li>
<li>Create and validate layer diagrams for C and C++ code.</li>
<li>Write custom code to create, modify, and validate layer diagrams.</li>
</ul>
<p>The following UML class diagram from <a href="http://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/" target="_blank">Giving a Presentation</a> was created using the Visualization and Modeling Feature Pack in just a couple of minutes:</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2010/06/classdiagram.png"><img style="display:inline;border-width:0;" title="ClassDiagram" src="http://fernandomachadopirizen.files.wordpress.com/2010/06/classdiagram_thumb.png?w=640&#038;h=347" border="0" alt="ClassDiagram" width="640" height="347" /></a></p>
<p>Do you recognize how the <a href="http://fernandomachadopirizen.wordpress.com/2010/06/10/a-simple-introduction-to-the-model-view-viewmodel-pattern-for-building-silverlight-and-windows-presentation-foundation-applications/" target="_blank">Model View View Model pattern</a> was used? It is easy from the diagram, is not it?</p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/announcements/'>Announcements</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a> Tagged: <a href='http://fernandomachadopirizen.wordpress.com/tag/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/giving-a-presentation/'>Giving a Presentation</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/uml/'>UML</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/visual-studio-2010/'>Visual Studio 2010</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=153&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2010/06/16/the-new-visualization-and-modeling-feature-pack-allows-generating-uml-diagrams-from-code-and-vice-versa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/06/classdiagram_thumb.png" medium="image">
			<media:title type="html">ClassDiagram</media:title>
		</media:content>
	</item>
		<item>
		<title>A simple introduction to the Model View ViewModel pattern for building Silverlight and Windows Presentation Foundation applications</title>
		<link>http://fernandomachadopirizen.wordpress.com/2010/06/10/a-simple-introduction-to-the-model-view-viewmodel-pattern-for-building-silverlight-and-windows-presentation-foundation-applications/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2010/06/10/a-simple-introduction-to-the-model-view-viewmodel-pattern-for-building-silverlight-and-windows-presentation-foundation-applications/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 00:41:44 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[.NET Framework 4.0]]></category>
		<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Giving a Presentation]]></category>
		<category><![CDATA[Model View ViewModel]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Presentation Foundation]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2010/06/10/a-simple-introduction-to-the-model-view-viewmodel-pattern-for-building-silverlight-and-windows-presentation-foundation-applications/</guid>
		<description><![CDATA[Some time ago I was looking for a simple introduction to the Model View ViewModel pattern (also known as MVVM) and all the samples I was able to find were a bit complicated to my taste. I this post I will try to present you the MVVM pattern using the simplest possible example, focusing just [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=142&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some time ago I was looking for a simple introduction to the <strong>Model View ViewModel</strong> pattern (also known as MVVM) and all the samples I was able to find were a bit complicated to my taste. I this post I will try to present you the MVVM pattern using the simplest possible example, focusing just on the key MVVM concepts. In other posts I will deep dive on other closely related concepts, but let us start with the basics.</p>
<p>MVVM is a successor of another well-known and very successful pattern so called <strong>Model View Controller</strong> (MVC). MVC was born (like many other well-known and successful patterns) in the Smalltalk world more than thirty years ago. Using MVC the application is composed by three kinds of objects, with very clear and differentiated responsibilities:</p>
<ul>
<li>The <strong>model</strong>. Usually there is only one model per application. The model is responsible for all application’s data and related business logic.</li>
<li>The <strong>view</strong> or views. One or more representations for the end user of the application’s model. The view is responsible for showing data to end users and for allowing end users to manipulate application’s data.</li>
<li>The <strong>controller</strong> or controllers. Usually there is one controller per view, although it is not uncommon to see one controller per domain entity controlling multiple views. The controller is responsible for transferring data from the model to the associated view and vice versa. It is also responsible for implementing view’s behavior to respond to user actions.</li>
</ul>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2010/06/image.png"><img style="display:inline;border-width:0;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/06/image_thumb.png?w=352&#038;h=161" border="0" alt="image" width="352" height="161" /></a> </p>
<p>With MVC each type of object is responsible for just one thing, which simplifies developing, understanding and testing the code. In addition, it is easy to replace views, or to have more than one view of the same data.</p>
<p>In the case of Silverlight and Windows Presentation Foundation (SL/WPF) applications, the .NET framework provides the ability to use <strong>binding</strong> to transfer data to and from the view, so the controller is only responsible for implementing view’s behavior. In this case, the controller is called view model, leading to the MVVM pattern:</p>
<ul>
<li>The <strong>model</strong>. Same as with MVC.</li>
<li>The <strong>view</strong> or views. Also the same as with MVC. Views are SL/WPF windows.</li>
<li>The <strong>view model</strong>. One view model per view. The view model is responsible for implementing view’s behavior to respond to user actions and for exposing model’s data in an “easy-to-bind” way to the view.</li>
</ul>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2010/06/image1.png"><img style="display:inline;border-width:0;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/06/image_thumb1.png?w=352&#038;h=162" border="0" alt="image" width="352" height="162" /></a></p>
<p>MVVC shares all of the benefits of MVC, but it has an additional benefit: the simplification resulting from using declarative binding to transfer data back and forth the view model to the view.</p>
<p>I will illustrate how MVVC works with an example. The code I will be using in this post comes from my sample application <strong>Giving a Presentation</strong> (although you are encouraged to download the <a href="http://givingapresentation.codeplex.com/releases/46905/download/126420" target="_blank">installation file</a> and the <a href="http://givingapresentation.codeplex.com/releases/46905/download/126421" target="_blank">source code</a> of Giving a Presentation from <a href="http://givingapresentation.codeplex.com/" target="_blank">CodePlex</a>, there is no need to do it in order to follow this post).</p>
<p>Giving a Presentation is a simple application to change certain setting while delivering a presentation, e.g., hide desktop icons, remove or replace desktop background, etc. Changes are reverted back when presentation ends.</p>
<p>The ability to change settings is provided by extensible parts and is not implemented in the application itself (more details in <a href="http://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/" target="_blank">this post</a>). So strictly speaking, the data Giving a Presentation deals with is just a boolean value indicating if the user is giving a presentation or not: the user sets the value on true when presentation starts, and set it back on false when presentation ends.</p>
<p>The <strong>model</strong>’s code is as follows. As promised, it is very simple; it has just a boolean property:</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:774c9807-ac38-404c-b277-6a465ffa2e7e" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: csharp; gutter: false; pad-line-numbers: true; toolbar: false;">
public class Model
{
    public bool GivingAPresentation { get; set; }
}
</pre>
</div>
<p>Here’s the <strong>view model</strong>’s code. It is also very simple. Like the model, it has a just a boolean property, whose value is get and set from an instance of the model.</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:64218337-a8c0-460e-873f-056cb8e7e411" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: csharp; gutter: false; toolbar: false;">
public class MainViewModel
{
    private Model model;
    public bool GivingAPresentation
    {
        get { return model.GivingAPresentation; }
        set
        {
            model.GivingAPresentation = value;
        }
    }

    public MainViewModel()
    {
        this.model = new Model();
    }
}
</pre>
</div>
<p>The <strong>view</strong> (without any extensible part on it) looks like this:</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2010/06/image3.png"><img style="display:inline;border:0;" title="image" src="http://fernandomachadopirizen.files.wordpress.com/2010/06/image_thumb3.png?w=244&#038;h=164" border="0" alt="image" width="244" height="164" /></a></p>
<p>The corresponding XAML code is:</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:678c08aa-0001-4832-bb90-fb4b1e2584b5" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: xml; gutter: false; html-script: false; toolbar: false;">
&lt;Window x:Class=&quot;GivingAPresentation.MainView&quot;
        xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
        xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
        xmlns:vm=&quot;clr-namespace:GivingAPresentation &quot;
        Title=&quot;Giving a Presentation&quot; Height=&quot;350&quot; Width=&quot;525&quot; Icon=&quot;/MvvmDemo;component/Images/Presentation.ico&quot;&gt;
    &lt;Window.Resources&gt;
        &lt;vm:MainViewModel x:Key=&quot;mainViewModel&quot;/&gt;
    &lt;/Window.Resources&gt;
    &lt;Grid&gt;
        &lt;CheckBox Content=&quot;I'm currently giving a presentation&quot;
                  HorizontalAlignment=&quot;Left&quot; VerticalAlignment=&quot;Top&quot; Margin=&quot;12,12,0,0&quot;
                  IsChecked=&quot;{Binding Source={StaticResource mainViewModel}, Mode=TwoWay, Path=GivingAPresentation}&quot; /&gt;
    &lt;/Grid&gt;
&lt;/Window&gt;
</pre>
</div>
<p>Interestingly, there is no code behind for this view<a name="_ftnref1_1916" href="#_ftn1_1916">[1]</a> (furthermore, I have deleted the file MainView.xaml.cs from the project, and obviously the solution compiles and the application runs perfectly). Do you wonder why? Because there is no need to have any code in view’s code behind class; view’s behavior is coded in the view model, not in the view, do you remember?</p>
<p>The view is connected with the view model in three steps. First, an <strong>xmlns</strong> attribute in the <strong>Window</strong> node is used to alias the <strong>GivingAPresentation</strong> namespace as <strong>vm</strong> with <strong>xmlns:vm=&#8221;clr-namespace:GivingAPresentation</strong>. Second, an instance of the view model is created in the <strong>Window.Resources</strong> node; the name of the instance is declared with x<strong>:Key=&#8221;mainViewModel&#8221;</strong>. And finally, the <strong>IsChecked</strong> property of the view’s check box is binded with view model’s <strong>GivingAPresentation</strong> property with <strong>IsChecked=&#8221;{Binding Source={StaticResource mainViewModel}, Mode=TwoWay, Path=GivingAPresentation}&#8221;</strong>.</p>
<p>And that’s it. WPF/SL does the magic of getting check box’s state from view model’s property value, which in turn is taken from the corresponding model’s property value. WPF/SL also does the magic of setting view model’s property value whenever the user checks or unchecks the check box. The view model propagates property value change to the corresponding property in the model. Through this chain, a change in the view is reflected in the model.</p>
<p>This example is perhaps too basic, but it has all the key components of the MVVM pattern, and clearly shows the basis for implementing WPF/SL applications using that pattern.</p>
<p>What is next? There many things, very common in real world scenarios, not resolved at all in this very simple demo; for example:</p>
<ol>
<li>Not only the view, but probably other objects need to be aware of changes in view model’s properties values. That is where the <strong>INotifyPropertyChanged</strong> interface comes in to play. By firing a <strong>PropertyChanged</strong> event every time properties’ values change, other objects can react to these changes. It is worth to mention that those objects are not known by the view model, but will be notified anyway, thanks to the .NET Framework’s events infrastructure.</li>
<li>It is very common for the view to ask its view model to execute certain actions. This can be achieved by the view model exposing commands, and the view binding control’s actions (like click) to those commands.</li>
<li>It is also very common in real live applications to have interdependent views that need to communicate between them. To keep those views, and their associated view models, independent from each other, view models can use messages to communicate between them.</li>
<li>Who creates who? In this simple demo the view declaratively creates the view model (in view’s XAML code), and the view model creates the model. In large applications, this approach is not always feasible, and you need other helper classes to manage objects creation.</li>
</ol>
<p>These aspects are really not part of the MVVM pattern, but are actually needed to implement real world applications using WPF/SL; that is why you usually will see them covered together with the MVVM pattern in the literature. I plan to cover them in future posts, just to keep the MVVM basics, basic.</p>
<p>Hope you have enjoyed this explanation. Looking forward to see you soon. Bye.</p>
<hr size="1" /><a name="_ftn1_1916" href="#_ftnref1_1916">[1]</a> In this example. In Giving a Presentation’s real code, the view is responsible for presentation related tasks, like showing the notification icon when minimized for example, that requires code behind the view.</p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/net-framework-4-0/'>.NET Framework 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/c-4-0/'>C# 4.0</a> Tagged: <a href='http://fernandomachadopirizen.wordpress.com/tag/net-framework-4-0/'>.NET Framework 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/giving-a-presentation/'>Giving a Presentation</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/model-view-viewmodel/'>Model View ViewModel</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/mvvm/'>MVVM</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/silverlight/'>Silverlight</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/windows-presentation-foundation/'>Windows Presentation Foundation</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/wpf/'>WPF</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=142&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2010/06/10/a-simple-introduction-to-the-model-view-viewmodel-pattern-for-building-silverlight-and-windows-presentation-foundation-applications/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/06/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/06/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/06/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Do you usually give presentations? Check this out</title>
		<link>http://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/#comments</comments>
		<pubDate>Wed, 26 May 2010 04:08:22 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[Giving a Presentation]]></category>
		<category><![CDATA[Inversion of Control]]></category>
		<category><![CDATA[Managed Extensibility Framework]]></category>
		<category><![CDATA[MEF]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/</guid>
		<description><![CDATA[For end users: Giving a Presentation is a simple application to change certain setting while delivering a presentation, e.g., hide desktop icons, disable screensaver, close selected programs, etc. Changes are reverted back when presentation ends. Initially built to show how to use certain technologies, it turned out to be useful by itself. Watch this video [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=132&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For end users: <strong>Giving a Presentation</strong> is a simple application to change certain setting while delivering a presentation, e.g., hide desktop icons, disable screensaver, close selected programs, etc. Changes are reverted back when presentation ends. Initially built to show how to use certain technologies, it turned out to be useful by itself.</p>
<p>Watch this video to see <strong>Giving a Presentation </strong>in action:</p>
<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:a26e8049-552c-44ce-9122-2bbcbbcb6871" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<div><span style="text-align:center; display: block;"><a href="http://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/"><img src="http://img.youtube.com/vi/6LHJ1lUym1Q/2.jpg" alt="" /></a></span></div>
</div>
<p>If you want to try <strong>Giving a Presentation</strong> for youself, you can download installation bits from <a href="http://givingapresentation.codeplex.com" target="_blank">Codeplex</a>.</p>
<p>For developers: <strong>Giving a Presentation</strong> is a WPF application sample created in C# that I use when blogging about <a href="http://fernandomachadopirizen.wordpress.com/2010/04/19/a-simple-introduction-to-the-microsoft-extensibility-framework/" target="_blank">Managed Extensibility Framework</a>, <a href="http://fernandomachadopirizen.wordpress.com/2010/05/07/inversion-of-control-dependency-injection-and-managed-extensibility-framework/" target="_blank">Dependency Injection and Inversion of Control</a>, etc. It demonstrates how an extensible application can be built as a container of component parts.</p>
<p>In this sample application, the container is the main window, plus the tab control on it. The tab control has just a <strong>Default</strong> tab and an <strong>About</strong> tab. The <strong>Default</strong> tab is initially empty; it will be dynamically filled by component parts.</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2010/05/clip_image002.png"><img style="display:inline;border-width:0;" title="clip_image002" src="http://fernandomachadopirizen.files.wordpress.com/2010/05/clip_image002_thumb.png?w=244&#038;h=164" border="0" alt="clip_image002" width="244" height="164" /></a></p>
<p>The <strong>About</strong> tab shows typical information about application version, etc.</p>
<p><a href="http://fernandomachadopirizen.files.wordpress.com/2010/05/clip_image003.png"><img style="display:inline;border-width:0;" title="clip_image003" src="http://fernandomachadopirizen.files.wordpress.com/2010/05/clip_image003_thumb.png?w=244&#038;h=164" border="0" alt="clip_image003" width="244" height="164" /></a></p>
<p>Component parts need to fulfill three requisites:</p>
<ol>
<li>Should implement an interface <strong>GivingAPresentation.Common.Contract</strong>.</li>
<li>Should the decorated with the <strong>System.ComponentModel.Composition</strong>’s <strong>Export </strong>attribute.</li>
<li>Should be deployed in an assembly in the same folder as the container.</li>
</ol>
<p>The Managed Extensibility Framework and the <strong>MainWindow</strong> of the application will do the rest. The former will load instances of all exported types implementing the mentioned required interface in a list. The later will take the instances in the list and add the controls to the appropriate tab in the control tab.</p>
<p>Until now, I have created three component parts, to solve some of the typical problems that appear when giving a presentation:</p>
<ul>
<li><strong>Hide desktop icons</strong>. Usually you place working documents in your desktop. Some of these documents are private and you don’t want your audience see them before you start delivering a presentation. Use this feature to hide your desktop icons during a presentation and unhide them at the end</li>
<li><strong>Disable screen saver</strong>. You may have your screen saver configured to start after certain time of inactivity. If you spend some time in a single slide during a presentation, your screen saver can interrupt your presentation. Use this feature to disable your screen saver during a presentation and enable it back at the end.</li>
<li><strong>Close programs</strong>. Some programs pop up notification messages, e.g., mail or instant messaging clients when messages arrive. Despite of the interruption, the content of the notification might be inappropriate to be seen by your audience during a presentation. Use this feature to close selected programs during a presentation and open them back at the end.</li>
</ul>
<p>Watch this video to see how these parts effectively extend the container:</p>
<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:ebc5b2b5-8368-402b-b3e5-8a5a84f62d2c" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<div><span style="text-align:center; display: block;"><a href="http://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/"><img src="http://img.youtube.com/vi/fhr_z88ko44/2.jpg" alt="" /></a></span></div>
</div>
<p>You can download the source code also from <a href="http://givingapresentation.codeplex.com" target="_blank">Codeplex</a>.</p>
<p>Give it a try. Hate it? Love it? Let me know.</p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a> Tagged: <a href='http://fernandomachadopirizen.wordpress.com/tag/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/dependency-injection/'>Dependency Injection</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/giving-a-presentation/'>Giving a Presentation</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/inversion-of-control/'>Inversion of Control</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/managed-extensibility-framework/'>Managed Extensibility Framework</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/mef/'>MEF</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/visual-studio-2010/'>Visual Studio 2010</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=132&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2010/05/26/do-you-usually-give-presentations-check-this-out/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/05/clip_image002_thumb.png" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>

		<media:content url="http://fernandomachadopirizen.files.wordpress.com/2010/05/clip_image003_thumb.png" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>
	</item>
		<item>
		<title>Intellitrace in Visual Studio 2010 and Team Foundation Server 2010</title>
		<link>http://fernandomachadopirizen.wordpress.com/2010/05/24/intellitrace-in-visual-studio-2010-and-team-foundation-server-2010/</link>
		<comments>http://fernandomachadopirizen.wordpress.com/2010/05/24/intellitrace-in-visual-studio-2010-and-team-foundation-server-2010/#comments</comments>
		<pubDate>Mon, 24 May 2010 19:40:32 +0000</pubDate>
		<dc:creator>fernandomachadopiriz</dc:creator>
				<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[Intellitrace]]></category>
		<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">https://fernandomachadopirizen.wordpress.com/2010/05/24/intellitrace-in-visual-studio-2010-and-team-foundation-server-2010/</guid>
		<description><![CDATA[This is the seventh (and latest) post of a series about testing tools and techniques using Visual Studio 2010, Team Foundation Server 2010, Microsoft Test Manager 2010, and C# 4.0. Certain bugs can be reproduced only if code is executed under certain conditions. If developers can’t recreate such conditions in their developing environment, it’s very [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=124&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the seventh (and latest) post of a <a href="http://fernandomachadopirizen.wordpress.com/2010/05/13/testing-with-visual-studio-2010/" target="_blank">series about testing tools and techniques</a> using Visual Studio 2010, Team Foundation Server 2010, Microsoft Test Manager 2010, and C# 4.0.</p>
<p>Certain bugs can be reproduced only if code is executed under certain conditions. If developers can’t recreate such conditions in their developing environment, it’s very unlikely for them to find these bugs. Visual Studio 2010 and Team Foundation Server 2010 can record events and calls during the execution of tests by using <strong>Intellitrace</strong>. Developers can later debug code reproducing those recorded <strong>Intellitrace</strong> files, like if they were using a VCR: they can go back and forward in the call stack, analyze parameters and result values, etc., even if their environment is completely different from the one where the <strong>Intellitrace</strong> file was recorded.</p>
<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:6d4a144f-8149-4e8c-8246-81c7c7451e45" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<div><span style="text-align:center; display: block;"><a href="http://fernandomachadopirizen.wordpress.com/2010/05/24/intellitrace-in-visual-studio-2010-and-team-foundation-server-2010/"><img src="http://img.youtube.com/vi/DlbyKkWKCNQ/2.jpg" alt="" /></a></span></div>
</div>
<p>You can also <a href="http://cid-8d961b36abfd7a76.skydrive.live.com/self.aspx/Public/7.%20Intellitrace-EN.zip" target="_blank">download the video</a>.</p>
<br />Filed under: <a href='http://fernandomachadopirizen.wordpress.com/category/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a> Tagged: <a href='http://fernandomachadopirizen.wordpress.com/tag/c-4-0/'>C# 4.0</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/intellitrace/'>Intellitrace</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/team-foundation-server/'>Team Foundation Server</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/testing/'>Testing</a>, <a href='http://fernandomachadopirizen.wordpress.com/tag/visual-studio-2010/'>Visual Studio 2010</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fernandomachadopirizen.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fernandomachadopirizen.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fernandomachadopirizen.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fernandomachadopirizen.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fernandomachadopirizen.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fernandomachadopirizen.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fernandomachadopirizen.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fernandomachadopirizen.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fernandomachadopirizen.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fernandomachadopirizen.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fernandomachadopirizen.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fernandomachadopirizen.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fernandomachadopirizen.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fernandomachadopirizen.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fernandomachadopirizen.wordpress.com&amp;blog=13079397&amp;post=124&amp;subd=fernandomachadopirizen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fernandomachadopirizen.wordpress.com/2010/05/24/intellitrace-in-visual-studio-2010-and-team-foundation-server-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a66b98cf9e1926d8929c4c46850951c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fernandomachadopiriz</media:title>
		</media:content>
	</item>
	</channel>
</rss>
