<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Guy Burstein</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bursteg/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bursteg/feed.xml</link>
    <description>Web, Cloud, Windows, Metro and HTML5</description>
    <lastBuildDate>Tue, 16 Apr 2019 04:50:15 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Remote Debugging Azure WebJobs: Attach a Debugger from Server Explorer</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/remote-debugging-azure-webjobs-attach-a-debugger-from-server-explorer</link>
      <pubDate>Fri, 14 Nov 2014 08:14:15 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2014/11/14/remote-debugging-azure-webjobs-attach-a-debugger-from-server-explorer/</guid>
      <description><![CDATA[I just blogged about Remote Debugging Azure WebJobs: Attach a Debugger from Server Explorer in Guy...]]></description>
      <content:encoded><![CDATA[<p>I just blogged about <a href="http://www.bursteg.com/remote-debugging-azure-webjobs-attach-a-debugger-from-server-explorer/">Remote Debugging Azure WebJobs: Attach a Debugger from Server Explorer</a> in <a href="http://www.bursteg.com/">Guy Burstein’s blog</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows 7: Create Flickr Federated Search Connector with .Net</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/windows-7-create-flickr-federated-search-connector-with-net</link>
      <pubDate>Wed, 29 Jul 2009 14:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/07/29/windows-7-create-flickr-federated-search-connector-with-net/</guid>
      <description><![CDATA[Windows 7: Create .Net Flickr Federated Search Connector  Windows 7 makes searching for content much...]]></description>
      <content:encoded><![CDATA[<h1>Windows 7: Create .Net Flickr Federated Search Connector</h1>  <p><strong>Windows 7</strong> makes searching for content much easier with <strong>Federated Search</strong>. In this post I’ll talk about how to <strong>how to create a Flickr Federated Search Providers in .Net</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" border="0" alt="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_1d4c2002-b693-4ca3-bfdf-da59debe965f.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_1d4c2002-b693-4ca3-bfdf-da59debe965f.png" width="640" height="293" />&#160; </p>  <h3>Before We Start</h3>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" border="0" alt="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" align="right" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/FlickrNet_3d09cc00-3e7a-47ea-8910-bb77e1bd0a42.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/FlickrNet_3d09cc00-3e7a-47ea-8910-bb77e1bd0a42.png" width="149" height="30" /> This sample uses Flickr API through Flickr.Net. In order to build your own version of this <strong>Flickr Federated Search Connector</strong>:</p>  <ul>   <li>Download <a href="http://flickrnet.codeplex.com/">Flickr.Net</a> from CodePlex </li>    <li>Acquire <a href="http://www.flickr.com/services/api/keys/">your API and Secret Keys for Flickr API</a>. </li> </ul>  <h3>Create a new ASP.Net Web Application</h3>  <p>Create a new ASP.Net Web Application with Visual Studio.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" border="0" alt="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_62ee89e9-bb31-48b1-a9bb-20514da06a72.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_62ee89e9-bb31-48b1-a9bb-20514da06a72.png" width="482" height="288" /> </p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" border="0" alt="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" align="right" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_7f840447-fa45-41b4-9e30-ef861376da68.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_7f840447-fa45-41b4-9e30-ef861376da68.png" width="177" height="206" />Add the <strong>Flickr.Net</strong> project (called FlickrNet.csproj) to your solution, and add a reference to it from your web application.</p>  <p>Add the Flickr API and Secret Key’s to your web.config in the AppSettings section:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">appSettings</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">add</span><span style="color: blue"> </span><span style="color: red">key</span><span style="color: blue">=</span>&quot;<span style="color: blue">flickr_api_key</span>&quot;<span style="color: blue"> </span><span style="color: red">value</span><span style="color: blue">=</span>&quot;<span style="color: blue">923422ab4225345dfgdb777daf46</span>&quot;<span style="color: blue">/&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">add</span><span style="color: blue"> </span><span style="color: red">key</span><span style="color: blue">=</span>&quot;<span style="color: blue">flickr_secret</span>&quot;<span style="color: blue"> </span><span style="color: red">value</span><span style="color: blue">=</span>&quot;<span style="color: blue">aa8b23fsdfhyc3beda</span>&quot;<span style="color: blue">/&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">appSettings</span><span style="color: blue">&gt;</span></p> </div>  <h3>Create the Flickr Search Provider</h3>  <p>The following provider will be executed by the Windows Explorer client using HTTP GET, and will receive several parameters from it:</p>  <p><font face="Courier New">http://localhost:52903/Search.aspx?<strong>q</strong>=TechEdIsrael2008&amp;<strong>start</strong>=1&amp;<strong>count</strong>=20</font></p>  <p>It will perform the search against Flickr, and return the response as RSS.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <div style="font-family: consolas; background: white; color: black; font-size: 11pt">     <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">rss</span><span style="color: blue"> </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">2.0</span>&quot;<span style="color: blue"> </span><span style="color: red">xmlns:media</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://search.yahoo.com/mrss/</span>&quot;<span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">channel</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span>Flickr Search Results<span style="color: blue">&lt;/</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">item</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span>IMG_0134c<span style="color: blue">&lt;/</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">link</span><span style="color: blue">&gt;</span>http://farm4.static.flickr.com/3100/2682983091_7cea404dc4_m.jpg<span style="color: blue">&lt;/</span><span style="color: #a31515">link</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">description</span><span style="color: blue">&gt;</span>show shadow dance techedisrael2008<span style="color: blue">&lt;/</span><span style="color: #a31515">description</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">pubDate</span><span style="color: blue">&gt;</span>Sun, 20 Jul 2008 01:47:25 GMT<span style="color: blue">&lt;/</span><span style="color: #a31515">pubDate</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">media:content</span><span style="color: blue"> </span><span style="color: red">url</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://farm4.static.flickr.com/3100/2682983091_7cea404dc4_b.jpg</span>&quot;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&#160;</span><span style="color: red">type</span><span style="color: blue">=</span>&quot;<span style="color: blue">image/jpeg</span>&quot;<span style="color: blue"> </span><span style="color: red">height</span><span style="color: blue">=</span>&quot;<span style="color: blue">333</span>&quot;<span style="color: blue"> </span><span style="color: red">width</span><span style="color: blue">=</span>&quot;<span style="color: blue">500</span>&quot;<span style="color: blue"> /&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">media:thumbnail</span><span style="color: blue"> </span><span style="color: red">url</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://farm4.static.flickr.com/3100/2_7cea404dc4_t.jpg</span>&quot;<span style="color: blue"> /&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;/</span><span style="color: #a31515">item</span><span style="color: blue">&gt;          <br />          <br /></span></p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">item</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; ...</p>      <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;/</span><span style="color: #a31515">item</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&#160; &lt;/</span><span style="color: #a31515">channel</span><span style="color: blue">&gt;</span></p>      <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">rss</span><span style="color: blue">&gt;</span></p>   </div> </div>  <p>Create a new Web Form called Search.aspx.</p>  <p>To make it easier to test the response, right click the web application, and open the <strong>Properties</strong> window. Go to the <strong>Web</strong> pane, select Search.aspx as the start page and provide the query parameters:</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" border="0" alt="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_d0fbbfd6-f22c-48c1-b69c-1773c0d0423b.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_d0fbbfd6-f22c-48c1-b69c-1773c0d0423b.png" width="482" height="163" /> </p>  <p>In the page markup, add a new asp:Repeater control that will define the template for each item in the response:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Repeater</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;</span> <span style="color: red">ID</span><span style="color: blue">=&quot;itemsRepeater&quot;&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Repeater</span><span style="color: blue">&gt;</span></p> </div>  <p>In the page code behind, implement the logic that uses Flickr.Net to search for photos and bind the result to the repeater control:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">protected</span> <span style="color: blue">void</span> Page_Load(<span style="color: blue">object</span> sender, <span style="color: #2b91af">EventArgs</span> e)</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: blue">string</span> flickrApiKey = <span style="color: #2b91af">WebConfigurationManager</span>.AppSettings[<span style="color: #a31515">&quot;flickr_api_key&quot;</span>];</p>    <p style="margin: 0px">&#160; <span style="color: blue">string</span> flickrSecret = <span style="color: #2b91af">WebConfigurationManager</span>.AppSettings[<span style="color: #a31515">&quot;flickr_secret&quot;</span>];</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; <span style="color: blue">string</span> searchTerm = Request.QueryString[<span style="color: #a31515">&quot;q&quot;</span>];</p>    <p style="margin: 0px">&#160; <span style="color: blue">int</span> startPage = <span style="color: blue">int</span>.Parse(Request.QueryString[<span style="color: #a31515">&quot;start&quot;</span>]);</p>    <p style="margin: 0px">&#160; <span style="color: blue">int</span> count = <span style="color: blue">int</span>.Parse(Request.QueryString[<span style="color: #a31515">&quot;count&quot;</span>]);</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; <span style="color: #2b91af">Flickr</span> flickr = <span style="color: blue">new</span> <span style="color: #2b91af">Flickr</span>();</p>    <p style="margin: 0px">&#160; flickr.ApiKey = flickrApiKey;</p>    <p style="margin: 0px">&#160; flickr.ApiSecret = flickrSecret;</p>    <p style="margin: 0px">&#160; <span style="color: #2b91af">Photos</span> photos = flickr.PhotosSearch(<span style="color: blue">null</span>, <span style="color: #a31515">&quot;&quot;</span>, 0, searchTerm,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #2b91af">DateTime</span>.MinValue,<span style="color: #2b91af"> DateTime</span>.MinValue, 0,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; count, startPage, <span style="color: #2b91af">PhotoSearchExtras</span>.All);</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; <span style="color: blue">this</span>.itemsRepeater.DataSource = photos.PhotoCollection;</p>    <p style="margin: 0px">&#160; <span style="color: blue">this</span>.itemsRepeater.DataBind();</p>    <p style="margin: 0px">}</p> </div>  <p>In the code above I first grab the API and secret key’s from the configuration file and then, I extract the parameters from the query string. I create a new instance of the Flickr object, and perform the actual search for photos, providing the page number and the number of items in each page. Finally, I bind the returned photo collection the the repeater control.</p>  <p>Replace the html header and footer with RSS header and footer in Search.aspx.</p>  <p>Before:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="background: #ffee62">&lt;%</span><span style="color: blue">@</span> <span style="color: #a31515">Page</span> <span style="color: red">Language</span><span style="color: blue">=&quot;C#&quot;</span> <span style="color: red">AutoEventWireup</span><span style="color: blue">=&quot;true&quot;</span> <span style="color: red">CodeBehind</span><span style="color: blue">=&quot;Search.aspx.cs&quot;</span> <span style="color: red">Inherits</span><span style="color: blue">=&quot;FlickrFederatedSearch.Search&quot;</span> <span style="background: #ffee62">%&gt;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">head</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">title</span><span style="color: blue">&gt;&lt;/</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">head</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">body</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">form</span> <span style="color: red">id</span><span style="color: blue">=&quot;form1&quot;</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">div</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Repeater</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;</span> <span style="color: red">ID</span><span style="color: blue">=&quot;itemsRepeater&quot;&gt;</span></p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Repeater</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">&lt;/</span><span style="color: #a31515">div</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">&lt;/</span><span style="color: #a31515">form</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">body</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">html</span><span style="color: blue">&gt;</span></p> </div>  <p>After:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="background: #ffee62">&lt;%</span><span style="color: blue">@</span> <span style="color: #a31515">Page</span> <span style="color: red">Language</span><span style="color: blue">=&quot;C#&quot;</span> <span style="color: red">AutoEventWireup</span><span style="color: blue">=&quot;true&quot;</span> <span style="color: red">CodeBehind</span><span style="color: blue">=&quot;Search.aspx.cs&quot;</span> <span style="color: red">Inherits</span><span style="color: blue">=&quot;FlickrFederatedSearch.Search&quot;</span> <span style="background: #ffee62">%&gt;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><strong><span style="color: blue">&lt;</span><span style="color: #a31515">rss</span> <span style="color: red">version</span><span style="color: blue">=&quot;2.0&quot;</span> <span style="color: #a31515">xmlns</span><span style="color: blue">:</span><span style="color: red">media</span><span style="color: blue">=&quot;http://search.yahoo.com/mrss/&quot;&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">channel</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span>Flickr Search Results<span style="color: blue">&lt;/</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Repeater</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;</span> <span style="color: red">ID</span><span style="color: blue">=&quot;itemsRepeater&quot;&gt;</span></p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Repeater</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160; <strong><span style="color: blue">&lt;/</span><span style="color: #a31515">channel</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong><span style="color: blue">&lt;/</span><span style="color: #a31515">rss</span><span style="color: blue">&gt;</span></strong></p> </div>  <p>Set the ItemTemplate of the Repeater control to display the photos data according to the output format:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Repeater</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;</span> <span style="color: red">ID</span><span style="color: blue">=&quot;itemsRepeater&quot;&gt;</span></p>    <p style="margin: 0px">&#160; <strong><span style="color: blue">&lt;</span><span style="color: #a31515">ItemTemplate</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">item</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span><span style="background: #ffee62">&lt;%</span><span style="color: blue">#</span> Eval(<span style="color: #a31515">&quot;Title&quot;</span>) <span style="background: #ffee62">%&gt;</span><span style="color: blue">&lt;/</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">link</span><span style="color: blue">&gt;</span><span style="background: #ffee62">&lt;%</span><span style="color: blue">#</span> Eval(<span style="color: #a31515">&quot;SmallUrl&quot;</span>)<span style="background: #ffee62">%&gt;</span><span style="color: blue">&lt;/</span><span style="color: #a31515">link</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">description</span><span style="color: blue">&gt;</span><span style="background: #ffee62">&lt;%</span><span style="color: blue">#</span> Eval(<span style="color: #a31515">&quot;CleanTags&quot;</span>)<span style="background: #ffee62">%&gt;</span><span style="color: blue">&lt;/</span><span style="color: #a31515">description</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">pubDate</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Literal</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;</span> </strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red">text</span><span style="color: blue">='</span><span style="background: #ffee62">&lt;%</span># ((FlickrNet.Photo)Container.DataItem).DateTaken.ToString(&quot;R&quot;) <span style="background: #ffee62">%&gt;</span><span style="color: blue">'</span> <span style="color: blue">/&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&lt;/</span><span style="color: #a31515">pubDate</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">media</span><span style="color: blue">:</span><span style="color: #a31515">content</span> <span style="color: red">url</span><span style="color: blue">='</span><span style="background: #ffee62">&lt;%</span># Eval(&quot;LargeUrl&quot;)<span style="background: #ffee62">%&gt;</span><span style="color: blue">'</span> <span style="color: red">type</span><span style="color: blue">=&quot;image/jpeg&quot;</span> <span style="color: blue">/&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">media</span><span style="color: blue">:</span><span style="color: #a31515">thumbnail</span> <span style="color: red">url</span><span style="color: blue">='</span><span style="background: #ffee62">&lt;%</span># Eval(&quot;ThumbnailUrl&quot;)<span style="background: #ffee62">%&gt;</span><span style="color: blue">'</span> <span style="color: blue">/&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160; <span style="color: blue">&lt;/</span><span style="color: #a31515">item</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><strong>&#160; <span style="color: blue">&lt;/</span><span style="color: #a31515">ItemTemplate</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Repeater</span><span style="color: blue">&gt;</span></p> </div>  <p>Run the application. The browser should navigate to Search.aspx passing all the relevant query parameters. The response should be an RSS feed that contains items per photos found.</p>  <h3>Creating the Flickr Federated Search Connector</h3>  <p>Add a new Xml file to the project and name it FlickrFederatedSearch<strong>.osdx</strong> (stands for OpenSearch Description Xml). This file contains the data that Windows Explorer needs to order to perform the search against the search service. </p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml</span><span style="color: blue"> </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot;<span style="color: blue"> </span><span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot;<span style="color: blue"> ?&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">OpenSearchDescription</span><span style="color: blue"> </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://a9.com/-/spec/opensearch/1.1/</span>&quot;<span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">ShortName</span><span style="color: blue">&gt;</span>Flickr Federated Search<span style="color: blue">&lt;/</span><span style="color: #a31515">ShortName</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">Url</span><span style="color: blue"> </span><span style="color: red">type</span><span style="color: blue">=</span>&quot;<span style="color: blue">application/rss+xml</span>&quot;<span style="color: blue">        <br />&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">template</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://.../Search.aspx?q={searchTerms}</span><span style="color: red">&amp;amp;</span><span style="color: blue">start={startPage}        <br /></span><span style="color: red">&amp;amp;</span><span style="color: blue">count={count}</span>&quot;<span style="color: blue"> /&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">OpenSearchDescription</span><span style="color: blue">&gt;</span></p> </div>  <p>Notice in the above xml that the parameters are taken from some predefined names ({searchTerms}, {count} etc.), and the ampersands (&amp;) are Html encoded.</p>  <p>Right click the .osdx file, and select Open With. </p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" border="0" alt="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_f0bff4aa-10b2-4f9d-a6b6-a18bd28bc7d6.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_f0bff4aa-10b2-4f9d-a6b6-a18bd28bc7d6.png" width="333" height="177" /></p>  <p>&#160; <br />In the Open With dialog, select Windows Explorer.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" border="0" alt="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_7cf95864-84c7-48cb-9460-5e567bb1cfa1.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_7cf95864-84c7-48cb-9460-5e567bb1cfa1.png" width="335" height="233" /> </p>  <p>In the Add Search Connector dialog, click <strong>Add</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_278d8875-7595-4c9d-b85f-8ab731187a58.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_278d8875-7595-4c9d-b85f-8ab731187a58.png" width="335" height="230" /> </p>  <p>Now, <strong>Flickr Federated Search</strong> appears in the Favorites section in <strong>Windows 7</strong> Explorer and you can use it for searching items. </p>  <p>&#160;<img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" border="0" alt="Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_93a5d5fd-bb4c-4920-8528-adc1e7acd64c.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/Window.NetFlickrFederatedSearchConnector_1025B/image_93a5d5fd-bb4c-4920-8528-adc1e7acd64c.png" width="480" height="220" /> </p>  <h3>Summary</h3>  <p>In this post I’ve talked about how to create a <strong>Flickr Federated Search Connector for Windows 7 in .Net</strong>. The above provider provides basic features and can be enhanced with more capabilities described in the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=C709A596-A9E9-49E7-BCD4-319664929317&amp;displaylang=en">Windows 7 Federated Search Provider Implementer’s Guide</a>.</p>  <p>Enjoy!</p>]]></content:encoded>
    </item>
    <item>
      <title>Getting Started with jQuery in Visual Studio 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/getting-started-with-jquery-in-visual-studio-2008</link>
      <pubDate>Fri, 05 Jun 2009 12:16:47 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/06/05/getting-started-with-jquery-in-visual-studio-2008/</guid>
      <description><![CDATA[Getting Started with jQuery in Visual Studio 2008    In this post I’ll talk about adding jQuery...]]></description>
      <content:encoded><![CDATA[<h1>Getting Started with jQuery in Visual Studio 2008</h1>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntellSense in Visual Studio 2008" border="0" alt="jQuery IntellSense in Visual Studio 2008" align="right" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/jQuery_c4e63ba1-bcde-4f12-bfe7-1f9bdb19641a.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/jQuery_c4e63ba1-bcde-4f12-bfe7-1f9bdb19641a.png" width="230" height="80" /></p>  <p>In this post I’ll talk about adding <strong>jQuery IntellSense in Visual Studio 2008</strong>, and how to add jQuery to a simple Web Application inside Visual Studio 2008.</p>  <h3>jQuery IntelliSense in Visual Studio 2008 - KB946581</h3>  <p>In order to use <strong>jQuery</strong> <strong>in Visual Studio 2008 with IntelliSence</strong> a <a href="http://blogs.msdn.com/webdevtools/archive/2008/02/09/downloadable-hotfix-performance-and-editor-fixes-for-microsoft-visual-studio-2008-and-visual-web-developer-express-2008.aspx">hotfix</a> for Visual Studio 2008 must be installed:</p>  <ol>   <li><a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826">Download the hotfix from Connect</a> </li>    <li>Run the executable and extract its contents to a folder in your hard drive. </li>    <li>Make sure all instances of Visual Studio 2008 are closed, and run <strong>VS90-KB946581.exe</strong> from the above folder. </li> </ol>  <h3>Download the Latest jQuery Library + Documentation</h3>  <p>To use <strong>jQuery in Visual Studio 2008</strong>, and enjoy its IntelliSense, you should download 2 javascript files. One contains the actual jQuery library, and the second contains the library with documentation for <strong>Visual Studio 2008</strong> to display its <strong>IntelliSense</strong>.</p>  <ol>   <li>Go to <a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery">jQuery Official Download Page</a> </li>    <li>Scroll down and find the <strong>Current Release</strong> section. </li>    <li>Download the <strong>Uncompressed</strong> version (<em>jquery-1.2.6.js</em>) and the documentation for Visual Studio (<em>jquery-1.2.6-vsdoc.js</em>). </li> </ol>  <h3>Using jQuery in a Visual Studio 2008 Web Application</h3>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntelliSense in Visual Studio 2008 - KB946581" border="0" alt="jQuery IntelliSense in Visual Studio 2008 - KB946581" align="right" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_16d672f5-3fb2-4157-928c-7d8ab9ba564a.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_16d672f5-3fb2-4157-928c-7d8ab9ba564a.png" width="165" height="153" />In a new Web Application or inside an existing one, add the jQuery scripts into a certain folder.</p>  <p>In a web page (or a master page), add a reference to the jQuery library:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">head</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span>jQuery Sample<span style="color: blue">&lt;/</span><span style="color: #a31515">title</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><strong>&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">script</span> <span style="color: red">src</span><span style="color: blue">=&quot;scripts/jquery-1.2.6.js&quot;</span>         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red">type</span><span style="color: blue">=&quot;text/javascript&quot;</span> <span style="color: blue">&gt;&lt;/</span><span style="color: #a31515">script</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">head</span><span style="color: blue">&gt;</span></p> </div>  <p></p>  <p></p>  <p>Then, in any javascript function you can start using <strong>jQuery</strong> functions and enjoy the <strong>IntelliSense in Visual Studio 2008</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntelliSense in Visual Studio 2008 - KB946581" border="0" alt="jQuery IntelliSense in Visual Studio 2008 - KB946581" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_1e8bdb45-be2b-4e76-a8b9-5542092344d9.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_1e8bdb45-be2b-4e76-a8b9-5542092344d9.png" width="293" height="96" /> </p>  <h3>A Simple Example of Using jQuery Functions</h3>  <p>For example, Assuming that you have a page with the following content in it:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">form</span> <span style="color: red">id</span><span style="color: blue">=&quot;form1&quot;</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">div</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">input</span> <span style="color: red">type</span><span style="color: blue">=&quot;text&quot;</span> <span style="color: red">class</span><span style="color: blue">=&quot;inputs&quot;</span> <span style="color: red">id</span><span style="color: blue">=&quot;txtName&quot;</span>       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red">value</span><span style="color: blue">=&quot;Enter Text Here&quot;</span> <span style="color: blue">/&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">&lt;</span><span style="color: #a31515">input</span> <span style="color: red">type</span><span style="color: blue">=&quot;button&quot;</span> <span style="color: red">class</span><span style="color: blue">=&quot;inputs&quot;</span> <span style="color: red">id</span><span style="color: blue">=&quot;btnSubmit&quot;</span>       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red">value</span><span style="color: blue">=&quot;Click Me&quot;</span> <span style="color: red"><strong>onclick</strong></span><span style="color: blue"><strong>=&quot;handleButtonClick();</strong>&quot;</span> <span style="color: blue">/&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">div</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">form</span><span style="color: blue">&gt;</span></p> </div>  <p></p>  <p></p>  <p>This form contains a single textbox followed by a button.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntelliSense in Visual Studio 2008 - KB946581" border="0" alt="jQuery IntelliSense in Visual Studio 2008 - KB946581" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_4ee94ee5-29c9-4c96-8e69-9abfc7a2249e.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_4ee94ee5-29c9-4c96-8e69-9abfc7a2249e.png" width="242" height="39" /> </p>  <p>The <em>handleButtonClick()</em> function handles the button <em>onclick</em> event.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">script</span> <span style="color: red">type</span><span style="color: blue">=&quot;text/javascript&quot;&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">function</span> handleButtonClick() {</p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">script</span><span style="color: blue">&gt;</span></p> </div>  <p></p>  <p>The way jQuery works is by selecting DOM elements and then doing something with them, such as executing a function or applying some properties. For example:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">script</span> <span style="color: red">type</span><span style="color: blue">=&quot;text/javascript&quot;&gt;</span></p>    <p style="margin: 0px">&#160; <span style="color: blue">function</span> handleButtonClick() {</p>    <p style="margin: 0px">&#160;&#160;&#160; <strong>$(<span style="color: #a31515">&quot;#txtName&quot;</span>).css(<span style="color: #a31515">&quot;border&quot;</span>, <span style="color: #a31515">&quot;solid 2px red&quot;</span>);</strong></p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">script</span><span style="color: blue">&gt;</span></p> </div>  <p>The above method uses the selector function <strong>$</strong> to select DOM elements (in this case – a single element with id = txtName) and to apply a style property of a red border. Running this page and clicking the button results in this output:</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntelliSense in Visual Studio 2008 - KB946581" border="0" alt="jQuery IntelliSense in Visual Studio 2008 - KB946581" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_c008d991-ab24-451d-89c2-068b7c05b1f8.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_c008d991-ab24-451d-89c2-068b7c05b1f8.png" width="249" height="33" /> </p>  <h3>Summary</h3>  <p>In this post I talked about the steps you should follow in order to use <strong>jQuery in Visual Studio 2008 with InstelliSense support</strong>. Then, we used jQuery in a simple web application.</p>]]></content:encoded>
    </item>
    <item>
      <title>Twitter API From C#: Getting a User’s Time Line</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/twitter-api-from-c-getting-a-users-time-line</link>
      <pubDate>Fri, 29 May 2009 05:39:01 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/05/29/twitter-api-from-c-getting-a-users-time-line/</guid>
      <description><![CDATA[Twitter API From C#: Getting a User’s Time Line   From Twitter API Documentation page:     User...]]></description>
      <content:encoded><![CDATA[<h1>Twitter API From C#: Getting a User’s Time Line</h1>  <p><img style="margin: 0px; display: inline" title="Twitter API C#: Getting Time Line" border="0" alt="Twitter API C#: Getting Time Line" align="right" src="http://blogs.microsoft.co.il/blogs/bursteg/twitter_423C17EA.jpg" width="295" height="72" /> From <a href="http://apiwiki.twitter.com/Twitter-API-Documentation">Twitter API Documentation page</a>:</p>  <blockquote>   <p><b>User Timeline:</b></p>    <p>Returns the 20 most recent statuses posted from the <u>authenticating user</u>:</p>    <p><a href="https://twitter.com/statuses/user_timeline.xml">https://twitter.com/statuses/user_timeline.xml</a></p>    <p>It's also possible to request another user's timeline. For example: </p>    <p><a href="https://twitter.com/statuses/user_timeline/bursteg.xml">https://twitter.com/statuses/user_timeline/bursteg.xml</a></p> </blockquote>  <h3>Making an HTTP Request</h3>  <p>Since all the API is expressed in REST, I figured out that I need a simple reusable method to perform HTTP requests. This method takes the URL and the method (GET or POST), gets the credentials from the configuration file and makes the request.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">private</span> <span style="color: blue">string</span> PerformRequest(<span style="color: blue">string</span> method, <span style="color: blue">string</span> url)</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">string</span> user = <span style="color: #2b91af">ConfigurationManager</span>.AppSettings[<span style="color: #a31515">&quot;user&quot;</span>];</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">string</span> password = <span style="color: #2b91af">ConfigurationManager</span>.AppSettings[<span style="color: #a31515">&quot;password&quot;</span>];</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">HttpWebRequest</span> request = (<span style="color: #2b91af">HttpWebRequest</span>)<span style="color: #2b91af">HttpWebRequest</span>.Create(url);</p>    <p style="margin: 0px">&#160;&#160;&#160; request.Method = method;</p>    <p style="margin: 0px">&#160;&#160;&#160; request.Credentials = <span style="color: blue">new</span> <span style="color: #2b91af">NetworkCredential</span>(user, password);</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">WebResponse</span> response = request.GetResponse();</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">StreamReader</span> reader = <span style="color: blue">new</span> <span style="color: #2b91af">StreamReader</span>(response.GetResponseStream());</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">string</span> responseString = reader.ReadToEnd();</p>    <p style="margin: 0px">&#160;&#160;&#160; reader.Close();</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">return</span> responseString;</p>    <p style="margin: 0px">}</p> </div>  <p>Just for the simplicity, I also added the following methods:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">private</span> <span style="color: blue">string</span> Post(<span style="color: blue">string</span> url)</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">return</span> PerformRequest(<span style="color: #a31515">&quot;POST&quot;</span>, url);</p>    <p style="margin: 0px">}</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="color: blue">private</span> <span style="color: blue">string</span> Get(<span style="color: blue">string</span> url)</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">return</span> PerformRequest(<span style="color: #a31515">&quot;GET&quot;</span>, url);</p>    <p style="margin: 0px">}</p> </div>  <h3>Getting a User’s Time Line from Twitter</h3>  <p>Using the following code, you can get a user’s timeline from twitter in xml&#160; format:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">string</span> url = <span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;https://twitter.com/statuses/friends/{0}.xml&quot;</span>, user);</p>    <p style="margin: 0px"><span style="color: blue">string</span> response = Get(url);</p> </div>  <p>This call returns the following piece of xml:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml</span><span style="color: blue"> </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot;<span style="color: blue"> </span><span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">UTF-8</span>&quot;<span style="color: blue">?&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">statuses</span><span style="color: blue"> </span><span style="color: red">type</span><span style="color: blue">=</span>&quot;<span style="color: blue">array</span>&quot;<span style="color: blue">&gt;        <br />        <br /></span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">status</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">created_at</span><span style="color: blue">&gt;</span>Sat Nov 15 10:08:15 +0000 2008<span style="color: blue">&lt;/</span><span style="color: #a31515">created_at</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">id</span><span style="color: blue">&gt;</span>1006846483<span style="color: blue">&lt;/</span><span style="color: #a31515">id</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">text</span><span style="color: blue">&gt;</span>Testing <span style="color: red">&amp;quot;</span>posts<span style="color: red">&amp;quot;</span> #devacademy3<span style="color: blue">&lt;/</span><span style="color: #a31515">text</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">source</span><span style="color: blue">&gt;</span>web<span style="color: blue">&lt;/</span><span style="color: #a31515">source</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">truncated</span><span style="color: blue">&gt;</span>false<span style="color: blue">&lt;/</span><span style="color: #a31515">truncated</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">in_reply_to_status_id</span><span style="color: blue">&gt;&lt;/</span><span style="color: #a31515">in_reply_to_status_id</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">in_reply_to_user_id</span><span style="color: blue">&gt;&lt;/</span><span style="color: #a31515">in_reply_to_user_id</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">favorited</span><span style="color: blue">&gt;</span>false<span style="color: blue">&lt;/</span><span style="color: #a31515">favorited</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">user</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">id</span><span style="color: blue">&gt;</span>6849932<span style="color: blue">&lt;/</span><span style="color: #a31515">id</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">name</span><span style="color: blue">&gt;</span>Guy Burstein<span style="color: blue">&lt;/</span><span style="color: #a31515">name</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">screen_name</span><span style="color: blue">&gt;</span>bursteg<span style="color: blue">&lt;/</span><span style="color: #a31515">screen_name</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">location</span><span style="color: blue">&gt;&lt;/</span><span style="color: #a31515">location</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">description</span><span style="color: blue">&gt;&lt;/</span><span style="color: #a31515">description</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">profile_image_url</span><span style="color: blue">&gt;</span>http://.../Guy_Burstein_Small_normal.jpg<span style="color: blue">&lt;/</span><span style="color: #a31515">profile_image_url</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">url</span><span style="color: blue">&gt;</span>http://blogs.microsoft.co.il/blogs/bursteg<span style="color: blue">&lt;/</span><span style="color: #a31515">url</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">protected</span><span style="color: blue">&gt;</span>false<span style="color: blue">&lt;/</span><span style="color: #a31515">protected</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">followers_count</span><span style="color: blue">&gt;</span>42<span style="color: blue">&lt;/</span><span style="color: #a31515">followers_count</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;/</span><span style="color: #a31515">user</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;/</span><span style="color: #a31515">status</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">status</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; ...</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;/</span><span style="color: #a31515">status</span><span style="color: blue">&gt;        <br />        <br /></span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">statuses</span><span style="color: blue">&gt;</span></p> </div>  <p>As we can see, this response is an array of statuses, each contains the details about the user who posted it.</p>  <h3>Extracting the Data</h3>  <p>With my favor to LINQ to XML, I used it to extract the data that I was interested in, and construct CLR objects that I can easily work with.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: #2b91af">XDocument</span> document = <span style="color: #2b91af">XDocument</span>.Parse(response, <span style="color: #2b91af">LoadOptions</span>.None);</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="color: blue">var</span> query = <span style="color: blue">from</span> e <span style="color: blue">in</span> document.Root.Descendants(<span style="color: #a31515">&quot;status&quot;</span>)</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">select</span> <span style="color: blue">new</span> <span style="color: #2b91af">UserStatus</span></p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UserName = e.Element(<span style="color: #a31515">&quot;user&quot;</span>).Element(<span style="color: #a31515">&quot;name&quot;</span>).Value,</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ProfileImage = e.Element(<span style="color: #a31515">&quot;user&quot;</span>).Element(<span style="color: #a31515">&quot;profile_image_url&quot;</span>).Value,</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Status = <span style="color: #2b91af">HttpUtility</span>.HtmlDecode(e.Element(<span style="color: #a31515">&quot;text&quot;</span>).Value),</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StatusDate = (e.Element(<span style="color: #a31515">&quot;created_at&quot;</span>).Value.ParseDateTime())</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };</p> </div>  <p>First, I parsed an xml document from the response string. Then, I created a list of <strong>UserStatus</strong> objects from the contents of the response xml.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">UserStatus</span></p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: blue">string</span> UserName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: blue">string</span> ProfileImage { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: blue">string</span> Status { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: #2b91af">DateTime</span> StatusDate { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }</p>    <p style="margin: 0px">}</p> </div>  <p>Few things to note about the above code:</p>  <p>1. <strong>HttpUtility.HtmlDecode</strong> is being used in order to get a readable text. The response contained text like “<em>Testing <span style="color: red">&amp;quot;</span>posts<span style="color: red">&amp;quot;</span> #devacademy3</em>” and this method (in System.Web) converts it to “Testing <span style="color: red">“</span>posts<span style="color: red">”</span> #devacademy3”.</p>  <p>2. The <strong>ParseDateTime()</strong> method on the element’s value is an extension method I created in order to parse a DateTime from the special string representation of the time the status was posted:</p>  <blockquote>   <p>Sat Nov 15 10:08:15 +0000 2008</p> </blockquote>  <p>This method looks like:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: blue">class</span> <span style="color: #2b91af">StringExtensions</span></p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: #2b91af">DateTime</span> ParseDateTime(<span style="color: blue">this</span> <span style="color: blue">string</span> date)</p>    <p style="margin: 0px">&#160;&#160;&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">string</span> dayOfWeek = date.Substring(0, 3).Trim();</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">string</span> month = date.Substring(4, 3).Trim();</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">string</span> dayInMonth = date.Substring(8, 2).Trim();</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">string</span> time = date.Substring(11, 9).Trim();</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">string</span> offset = date.Substring(20, 5).Trim();</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">string</span> year = date.Substring(25, 5).Trim();</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">string</span> dateTime = <span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;{0}-{1}-{2} {3}&quot;</span>, dayInMonth, month, year, time);</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #2b91af">DateTime</span> ret = <span style="color: #2b91af">DateTime</span>.Parse(dateTime);</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">return</span> ret;</p>    <p style="margin: 0px">&#160;&#160;&#160; }</p>    <p style="margin: 0px">}</p>    <p style="margin: 0px">&#160;</p> </div>  <p style="margin: 0px">If you come up with another idea of how to parse this string into a DateTime object, please let me know. </p>  <p></p>  <h3>Wrapping it up...</h3>  <p>The final version of the <strong>GetUserTimeLine</strong> method looks like this:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">UserStatus</span>&gt; GetUserTimeLine(<span style="color: blue">string</span> user)</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">string</span> url = <span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;https://twitter.com/statuses/user_timeline/{0}.xml&quot;</span>, user);</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">string</span> response = Get(url);</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">XDocument</span> document = <span style="color: #2b91af">XDocument</span>.Parse(response, <span style="color: #2b91af">LoadOptions</span>.None);</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">var</span> query = <span style="color: blue">from</span> e <span style="color: blue">in</span> document.Root.Descendants(<span style="color: #a31515">&quot;status&quot;</span>)</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">select</span> <span style="color: blue">new</span> <span style="color: #2b91af">UserStatus</span></p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UserName = e.Element(<span style="color: #a31515">&quot;user&quot;</span>).Element(<span style="color: #a31515">&quot;name&quot;</span>).Value,</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ProfileImage = e.Element(<span style="color: #a31515">&quot;user&quot;</span>).Element(<span style="color: #a31515">&quot;profile_image_url&quot;</span>).Value,</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Status = <span style="color: #2b91af">HttpUtility</span>.HtmlDecode(e.Element(<span style="color: #a31515">&quot;text&quot;</span>).Value),</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StatusDate = (e.Element(<span style="color: #a31515">&quot;created_at&quot;</span>).Value.ParseDateTime())</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">UserStatus</span>&gt; users = (<span style="color: blue">from</span> u <span style="color: blue">in</span> query</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">where</span> u.Status != <span style="color: #a31515">&quot;&quot;</span></p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">orderby</span> u.StatusDate <span style="color: blue">descending</span></p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">select</span> u).ToList();</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">return</span> users;</p>    <p style="margin: 0px">}</p> </div>  <p>The techniques I’ve used here can be used in almost all the “get” methods of the REST API of Twitter.</p>  <p>Enjoy!</p>]]></content:encoded>
    </item>
    <item>
      <title>ASP.Net MVC on Windows Azure | ASP.Net MVC Web Role</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/asp-net-mvc-on-windows-azure-asp-net-mvc-web-role</link>
      <pubDate>Sat, 23 May 2009 09:48:53 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/05/23/asp-net-mvc-on-windows-azure-asp-net-mvc-web-role/</guid>
      <description><![CDATA[ASP.Net MVC on Windows Azure | ASP.Net MVC Web Role      When you install Windows Azure Tools for...]]></description>
      <content:encoded><![CDATA[<h1>ASP.Net MVC on Windows Azure | ASP.Net MVC Web Role</h1>  <p></p>  <p></p>  <p><img style="border-right-width: 0px; margin: 0px 0px 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" align="right" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/Windows%20Azure_509b3e81-f8c9-4902-8f09-b23ffb37c8b7.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/Windows%20Azure_509b3e81-f8c9-4902-8f09-b23ffb37c8b7.png" width="210" height="46" />When you install <strong>Windows Azure</strong> Tools for Visual Studio, you only get a project template for an <strong>ASP.Net Web Role</strong>. In this post I’ll talk about how to create a new <strong>ASP.Net MVC Web Role</strong> or move an existing <strong>ASP.Net MVC</strong> Application to <strong>Windows Azure</strong>.</p>  <p>There are 2 ways to do this:</p>  <ul>   <li><strong><img style="border-right-width: 0px; margin: 20px 0px 20px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" align="right" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/ASP.Net_70989e8d-4535-4165-90b9-0063e2caf5cc.jpg" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/ASP.Net_70989e8d-4535-4165-90b9-0063e2caf5cc.jpg" width="194" height="37" />Manually</strong> adding an <strong>ASP.Net MVC application as a Web Role</strong> (suitable both for a new ASP.Net MVC application and for an existing one). </li>    <li>Use a <strong>Project Template</strong> to simply create a new ASP.Net MVC Web Role (new ASP.Net MVC application only). </li> </ul>  <h3>Creating a New ASP.Net MVC Web Role</h3>  <p>The following steps apply both for creating a new ASP.Net MVC application and to moving an existing ASP.Net MVC application to Windows Azure.</p>  <p>1. Create an empty <strong>ASP.Net MVC Application</strong> (with or without a test project), or make sure you have an existing ASP.Net MVC application that you want to move to the Windows Azure.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_7480b545-4684-403f-8c94-4b0fec7fcb6b.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_7480b545-4684-403f-8c94-4b0fec7fcb6b.png" width="480" height="337" /> </p>  <p>2. Close this solution and create a new <strong>Blank Cloud Service</strong>. Make sure you start <strong>Visual Studio as an administrator</strong> because working with the <strong>Development Fabric</strong> requires that.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_194348b3-c798-4921-b117-a6533830e3c6.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_194348b3-c798-4921-b117-a6533830e3c6.png" width="480" height="350" /> </p>  <p>3. <strong>Add an existing project</strong> to the cloud service and select the ASP.Net MVC Application you have created earlier.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_d8cd1cbb-c082-41db-9ca4-8b9742cf7d33.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_d8cd1cbb-c082-41db-9ca4-8b9742cf7d33.png" width="174" height="249" /> </p>  <p>4. <strong>Right click</strong> the ASP.Net MVC project and select <strong>Unload Project</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_27de367c-f84c-4213-9765-bb4318527a0e.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_27de367c-f84c-4213-9765-bb4318527a0e.png" width="343" height="285" /> </p>  <p>5. When the project is unloaded, right click it and <strong>edit the project file</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_bfcb6249-7b5b-4c91-82b4-86797b7edae7.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_bfcb6249-7b5b-4c91-82b4-86797b7edae7.png" width="380" height="187" /> </p>  <p>6. The project file opens in the XML Editor. </p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">Project</span><span style="color: blue"> </span><span style="color: red">ToolsVersion</span><span style="color: blue">=</span>&quot;<span style="color: blue">3.5</span>&quot;<span style="color: blue"> </span><span style="color: red">DefaultTargets</span><span style="color: blue">=</span>&quot;<span style="color: blue">Build</span>&quot; ...<span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">PropertyGroup</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">Configuration</span><span style="color: blue"> </span><span style="color: red">Condition</span><span style="color: blue">=</span>&quot;<span style="color: blue"> '$(Configuration)' == '' </span>&quot;<span style="color: blue">&gt;</span>Debug<span style="color: blue">&lt;/</span><span style="color: #a31515">Configuration</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; ...</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;/</span><span style="color: #a31515">PropertyGroup</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; ...        <br /></span><span style="color: blue">&lt;/</span><span style="color: #a31515">Project</span><span style="color: blue">&gt;</span></p> </div>  <p>Inside the <strong>PropertyGroup</strong> Element, add the <strong>RoleType</strong> element and mark this <strong>ASP.Net MVC project as a Web Role</strong>.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">Project</span><span style="color: blue"> </span><span style="color: red">ToolsVersion</span><span style="color: blue">=</span>&quot;<span style="color: blue">3.5</span>&quot;<span style="color: blue"> </span><span style="color: red">DefaultTargets</span><span style="color: blue">=</span>&quot;<span style="color: blue">Build</span>&quot; ...<span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; &lt;</span><span style="color: #a31515">PropertyGroup</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><strong><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">RoleType</span><span style="color: blue">&gt;</span>Web<span style="color: blue">&lt;/</span><span style="color: #a31515">RoleType</span><span style="color: blue">&gt;</span></strong></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">Configuration</span><span style="color: blue"> </span><span style="color: red">Condition</span><span style="color: blue">=</span>&quot;<span style="color: blue"> '$(Configuration)' == '' </span>&quot;<span style="color: blue">&gt;</span>Debug<span style="color: blue">&lt;/</span><span style="color: #a31515">Configuration</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; ...        <br /></span><span style="color: blue">&#160; &lt;/</span><span style="color: #a31515">PropertyGroup</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160; ...</span></p>    <p style="margin: 0px"><span style="color: blue"></span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">Project</span><span style="color: blue">&gt;</span></p> </div>  <p>7. Close this project file, and <strong>reload the project</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_b78ce925-6a89-4082-bc2e-18cc23e68df3.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_b78ce925-6a89-4082-bc2e-18cc23e68df3.png" width="356" height="172" /> </p>  <p>8. Since the ASP.Net MVC now runs on the Windows Azure Service Hosting environment and will probably use its services – add a reference to <strong>Microsoft.ServiceHosting.ServiceRuntime.dll</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_519f5a16-0840-4178-8427-d3a9e97624c1.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_519f5a16-0840-4178-8427-d3a9e97624c1.png" width="480" height="313" /> </p>  <p>9. <strong>Right click</strong> the <strong>Roles</strong> node in the project tree, and add a <strong>Web Role Project in the solution. </strong>Select the ASP.Net MVC project from the project list.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_f701a824-9b9e-490f-99a0-3eaedc7118e8.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_f701a824-9b9e-490f-99a0-3eaedc7118e8.png" width="412" height="148" /> </p>  <p>Now the <strong>ASP.Net MVC</strong> project is shown as a <strong>Web Role</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_343b4c86-2ae0-41a4-9324-92f8ad13a4fa.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_343b4c86-2ae0-41a4-9324-92f8ad13a4fa.png" width="234" height="176" /> </p>  <p>10. Since the <strong>Windows Azure</strong> provides us only with the default .Net Framework 3.5 SP1 assemblies, we must make sure we also copy the <strong>ASP.Net MVC</strong> Assemblies to the cloud. To do this, right click on each of the following references of the <strong>ASP.Net MVC</strong> application, and set the <strong>Copy Local</strong> property to <strong>True:</strong></p>  <ul>   <li><strong>System.Web.Abstractions </strong></li>    <li><strong>System.Web.Mvc </strong></li>    <li><strong>System.Web.Routing</strong> </li> </ul>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_9f34c473-b440-4a12-82ca-e8d8c52cfca7.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_9f34c473-b440-4a12-82ca-e8d8c52cfca7.png" width="251" height="255" />&#160;</p>  <p>That’s it. You can run the application to make sure that it is running on the <strong>Development Fabric</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_b4175024-90c5-49db-ae63-303b599985d6.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_b4175024-90c5-49db-ae63-303b599985d6.png" width="480" height="309" /> </p>  <p></p>  <p></p>  <p></p>  <p></p>  <p>Creating an ASP.Net MVC Web Role using a Project Template</p>  <p>Thanks to a great word done by the community, we can use a project template to do all the above steps for us. Here’s how to do this:</p>  <p>1. Download the project template from Codeplex at <a href="http://c4mvc.codeplex.com/">http://c4mvc.codeplex.com/</a>. </p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_40e0ece2-06d7-49f3-878b-c800f99aaf0e.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_40e0ece2-06d7-49f3-878b-c800f99aaf0e.png" width="286" height="214" /> </p>  <p>2. Create a new project and select the <strong>Azure ASP.Net MVC</strong> template in the <strong>Community for MVC</strong> category.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_e872dc55-5843-480e-af21-5af2a468c3a1.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_e872dc55-5843-480e-af21-5af2a468c3a1.png" width="480" height="377" /> </p>  <p>This creates a new <strong>Cloud Service for Windows Azure with ASP.Net MVC Application as a Web Role</strong>.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_ed99fda9-ed48-489b-8e83-fd53cc5fa24b.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_ed99fda9-ed48-489b-8e83-fd53cc5fa24b.png" width="158" height="305" /> </p>  <p>Enjoy!</p>]]></content:encoded>
    </item>
    <item>
      <title>WF/WCF using Visual Studio 2010 and .NET Framework 4 Training Kit</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/wfwcf-using-visual-studio-2010-and-net-framework-4-training-kit</link>
      <pubDate>Tue, 19 May 2009 09:23:59 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/05/19/wfwcf-using-visual-studio-2010-and-net-framework-4-training-kit/</guid>
      <description><![CDATA[WF/WCF using Visual Studio 2010 and .NET Framework 4 Training Kit  &#160;&#160;    The Microsoft...]]></description>
      <content:encoded><![CDATA[<h1>WF/WCF using Visual Studio 2010 and .NET Framework 4 Training Kit</h1>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF/WCF using Visual Studio 2010 and .NET Framework 4 Training Kit" border="0" alt="WF/WCF using Visual Studio 2010 and .NET Framework 4 Training Kit" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WFWCFusingVisua.NETFramework4TrainingKit_E64B/WF_826378c6-a02d-44ec-8662-a875643db14e.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WFWCFusingVisua.NETFramework4TrainingKit_E64B/WF_826378c6-a02d-44ec-8662-a875643db14e.png" width="263" height="51" />&#160;&#160; <img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF/WCF using Visual Studio 2010 and .NET Framework 4 Training Kit" border="0" alt="WF/WCF using Visual Studio 2010 and .NET Framework 4 Training Kit" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WFWCFusingVisua.NETFramework4TrainingKit_E64B/WCF_449d2a51-c2ce-4abe-80d6-0a156237c6b9.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WFWCFusingVisua.NETFramework4TrainingKit_E64B/WCF_449d2a51-c2ce-4abe-80d6-0a156237c6b9.png" width="310" height="47" /> </p>  <p>The <strong>Microsoft WF/WCF using Visual Studio 2010 and .NET Framework 4 Training Kit</strong> includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2010 features and a variety of WF and WCF new features.</p>  <ul>   <li>Learn <strong>basic workflow creation</strong>, hosting and running , and test-drive workflow development. </li>    <li>Get an introduction to workflow services, communication between workflows and content based correlation of workflow instances. </li>    <li>Use the flexibility of <strong>Flowchart</strong> workflow activities to implement non-sequential workflows. </li>    <li>Learn how to <strong>rehost the workflow designer</strong> in a WPF desktop application and customize it in several ways. </li>    <li>Learn how you can leverage some of the main <strong>WF and WCF monitoring</strong> features to track application execution and troubleshoot problems with services when necessary. </li>    <li>Learn how <strong>Service discovery</strong> allows you to locate services on the same subnet using ad hoc discovery, or using a proxy to establish connections with servers regardless of where they are. </li> </ul>  <p>This version of the training kit is compatible with <a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2009/05/18/visual-studio-2010-beta-1-is-available-for-msdn-subscribers.aspx">Visual Studio 2010 Beta 1</a>.</p>  <p>Download <a href="http://code.msdn.microsoft.com/wcfwf4/Release/ProjectReleases.aspx?ReleaseId=2698">here</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>WF 4.0: Long Running Custom Activities with Bookmarks and NativeActivity</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/wf-4-0-long-running-custom-activities-with-bookmarks-and-nativeactivity</link>
      <pubDate>Tue, 19 May 2009 08:40:19 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/05/19/wf-4-0-long-running-custom-activities-with-bookmarks-and-nativeactivity/</guid>
      <description><![CDATA[WF 4.0: Long Running Custom Activities with Bookmarks and NativeActivity    This is another post in...]]></description>
      <content:encoded><![CDATA[<h1>WF 4.0: Long Running Custom Activities with Bookmarks and NativeActivity</h1>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0: Long Running Custom Activities Bookmarks NativeActivity" border="0" alt="WF 4.0: Long Running Custom Activities Bookmarks NativeActivity" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0LongRunningCustomActivitieswithBook_C900/WF23_27f3f317-ca61-4fb3-a994-5986cb0115c8.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0LongRunningCustomActivitieswithBook_C900/WF23_27f3f317-ca61-4fb3-a994-5986cb0115c8.png" width="314" height="61" /></p>  <p>This is another post in my <a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2009/05/19/wf-4-0-custom-activities.aspx">WF 4.0: Custom Activities series</a>. In a previous post I have talked about creating a code only custom activity that performs a simple task. In this post I’ll talk about creating a more complex activities that takes inputs from the calling program during their execution.</p>  <p>In the previous post <a href="http://blogs.msdn.com/bursteg/archive/2009/05/19/wf-4-0-code-only-custom-activities-for-atomic-actions-codeactivity-codeactivity-t.aspx">WF 4.0: Code Only Custom Activities for Atomic Actions | CodeActivity, CodeActivity&lt;T&gt;</a> I implemented the following activity for reading a string from the console.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">ReadString2</span> : <span style="color: #2b91af">CodeActivity</span>&lt;<span style="color: blue">string</span>&gt;</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">CodeActivityContext</span> context)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">string</span> value = <span style="color: #2b91af">Console</span>.ReadLine();</p>    <p style="margin: 0px">&#160;&#160;&#160; context.SetValue(Result, value);</p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">}</p> </div>  <p>While this activity will perform the task it is meant to do, it is bloc<strong>king the calling thread and bad for scalability</strong>. In addition to that It is bound to getting the value from the console only, and it is <strong>not generic enough</strong> to support another input methods.</p>  <p>Enter <strong>Bookmarks</strong>.</p>  <h3>Using NativeActivity for Complex Activities</h3>  <p>To create a long running activity, add a new item of type <strong>Workflow Element</strong> item to the project. Notice that the default activity inherits from <strong>CodeActivity</strong>.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">ReadString3</span> : <span style="color: #2b91af">CodeActivity</span></p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">CodeActivityContext</span> context)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">}</p> </div>  <p>To create complex activities such as long running activities, me need to change the base class and inherit from <strong>NativeActivity</strong> or <strong>NativeActivity&lt;T&gt;.</strong> In addition to that, there is a difference between the type of the parameter that the <strong>CodeActivity</strong> takes for the Execute method and the type that <strong>NativeActivity</strong> takes. Change the input parameter type from <strong>CodeActivityContext</strong> to <strong>ActivityExecutionContext</strong>.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">ReadString3</span> : <span style="color: #2b91af">NativeActivity</span></p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">ActivityExecutionContext</span> context)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">NotImplementedException</span>();</p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">}</p> </div>  <h3>Enter Bookmarks</h3>  <p>In previous versions of <strong>Windows Workflow Foundation</strong> we had the <strong>ExternalDataExchangeService</strong> and <strong>WorkflowQueue</strong> when we wanted to build a simple long running activity. In <strong>WF 4.0</strong> this is much more simple to do using <strong>Bookmarks</strong>.</p>  <p>To use bookmarks we need to:</p>  <ul>   <li>Create a named bookmark and Implement a callback method </li>    <li>Signal from the caller program </li> </ul>  <h3>Register a Named Bookmak</h3>  <p>The following activity registers a bookmark called “input” with a callback method called <strong>OnBookmarkCallback</strong>.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">ReadString3</span> : <span style="color: #2b91af">NativeActivity</span></p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: #2b91af">OutArgument</span>&lt;<span style="color: blue">string</span>&gt; name;</p>    <p style="margin: 0px">&#160; <span style="color: blue">public</span> <span style="color: #2b91af">OutArgument</span>&lt;<span style="color: blue">string</span>&gt; Name</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">get</span> { <span style="color: blue">return</span> <span style="color: blue">this</span>.name; }</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">set</span></p>    <p style="margin: 0px">&#160;&#160;&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; ThrowIfOpen();</p>    <p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: blue">this</span>.name = <span style="color: blue">value</span>;</p>    <p style="margin: 0px">&#160;&#160;&#160; }</p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">ActivityExecutionContext</span> context)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <strong>context.CreateNamedBookmark(<span style="color: #a31515">&quot;input&quot;</span>, <span style="color: blue">new</span> <span style="color: #2b91af">BookmarkCallback</span>(<span style="color: blue">this</span>.OnBookmarkCallback));</strong></p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; <strong><span style="color: blue">void</span> OnBookmarkCallback(<span style="color: #2b91af">ActivityExecutionContext</span> context, <span style="color: #2b91af">Bookmark</span> bookmark, <span style="color: blue">object</span> obj)</strong></p>    <p style="margin: 0px"><strong>&#160; {</strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160; <span style="color: blue">this</span>.Name.Set(context, (<span style="color: blue">string</span>)obj);</strong></p>    <p style="margin: 0px"><strong>&#160; }</strong></p>    <p style="margin: 0px">}</p> </div>  <h3>Signal the workflow from the caller program</h3>  <p>In a previous post I have talked about <a href="WF 4.0: How to Execute a Worklflow (WorkflowInvoker vs WorkflowInstance)">the code that is needed to execute a workflow</a>. Since we are now talking about long running workflows we will start with the default code that is generated for us when we create a new sequential workflow console application that uses the <strong>WorkflowInstance</strong> that lets know when the workflow instance is idle, and to resume a bookmark:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px">...</p>    <p style="margin: 0px">myInstance.Run();</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="color: green">//Get a string from the console and resume the bookmark called “input”</span></p>    <p style="margin: 0px"><strong><span style="color: blue">string</span> input = <span style="color: #2b91af">Console</span>.ReadLine();</strong></p>    <p style="margin: 0px"><strong>myInstance.ResumeBookmark(<span style="color: #a31515">&quot;input&quot;</span>, input);</strong></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">syncEvent.WaitOne();      <br />...       <br /></p> </div>  <p>The main program performs the input and delivers the value to the workflow. Using this approach:</p>  <ul>   <li>The main program is flexible in how it wants to get values from the user and any other input source </li>    <li>The workflow becomes idle when it is waiting for the input and during that time not consuming any resources from the machine. </li> </ul>  <p>To query the available bookmarks in a workflow instance, we can use the following code:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: #2b91af">IList</span> bookmarks = myInstance.GetAllBookmarks();</p>    <p style="margin: 0px"><span style="color: blue">foreach</span> (<span style="color: #2b91af">BookmarkInfo</span> info <span style="color: blue">in</span> bookmarks)</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: #2b91af">Console</span>.Write(info.BookmarkName);</p>    <p style="margin: 0px">}</p> </div>  <p>Enjoy!</p>]]></content:encoded>
    </item>
    <item>
      <title>WF 4.0: Code Only Custom Activities for Atomic Actions | CodeActivity, CodeActivity&lt;T&gt;</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/wf-4-0-code-only-custom-activities-for-atomic-actions-codeactivity-codeactivityt</link>
      <pubDate>Tue, 19 May 2009 07:03:52 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/05/19/wf-4-0-code-only-custom-activities-for-atomic-actions-codeactivity-codeactivityt/</guid>
      <description><![CDATA[WF 4.0: Code Only Custom Activities for Atomic Actions | CodeActivity, CodeActivity&lt;T&gt;    This...]]></description>
      <content:encoded><![CDATA[<h1>WF 4.0: Code Only Custom Activities for Atomic Actions | CodeActivity, CodeActivity&lt;T&gt;</h1>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0  Code Custom Activities CodeActivity CodeActivity&lt;T&gt;" border="0" alt="WF 4.0  Code Custom Activities CodeActivity CodeActivity&lt;T&gt;" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0CodeOnlyCustomActivitiesforAtomicAc_B180/WF%5B2%5D_84b491c4-5c90-4ea3-a124-672167c54855.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0CodeOnlyCustomActivitiesforAtomicAc_B180/WF%5B2%5D_84b491c4-5c90-4ea3-a124-672167c54855.png" width="314" height="61" /></p>  <p>This is another post in my <a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2009/05/19/wf-4-0-custom-activities.aspx">WF 4.0: Custom Activities series</a>. In this post I’ll talk about creating a code only custom activity that performs a simple task. I’ll also use input and output parameters and talk about activities that returns a single value.</p>  <h3>A Simple Code Activity</h3>  <p>Lets start by building a simple activity that outputs a certain string to the console. To to that, lets add a new item of type <strong>Workflow Element</strong> (under the Workflow node in the item templates).</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0  Code Custom Activities CodeActivity CodeActivity&lt;T&gt;" border="0" alt="WF 4.0  Code Custom Activities CodeActivity CodeActivity&lt;T&gt;" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0CodeOnlyCustomActivitiesforAtomicAc_B180/image_6a34e51b-f707-4373-a8ef-bb2bca587fff.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0CodeOnlyCustomActivitiesforAtomicAc_B180/image_6a34e51b-f707-4373-a8ef-bb2bca587fff.png" width="480" height="275" /> </p>  <p>Visual Studio adds a new code file (remember – this is a code-only activity) with a class that inherits from the abstract class <strong>System.Activities.CodeActivity</strong>.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">OutputString</span> : <span style="color: #2b91af">CodeActivity</span></p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">CodeActivityContext</span> context)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">}</p> </div>  <p>To implement the logic of the atomic action, we just have to code it here. Notice that we don’t have to tell the runtime that the status of this activity is closed or something like this like we had to in WF 3.5.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">OutputString</span> : <span style="color: #2b91af">CodeActivity</span></p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">CodeActivityContext</span> context)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">&quot;Hello world&quot;</span>);</p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">}</p> </div>  <p>After building the project, the new custom activity will appear in the Toolbox, and can be used in the workflow.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0  Code Custom Activities CodeActivity CodeActivity&lt;T&gt;" border="0" alt="WF 4.0  Code Custom Activities CodeActivity CodeActivity&lt;T&gt;" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0CodeOnlyCustomActivitiesforAtomicAc_B180/image_abaeffc1-dc75-486f-add1-2cb7fe8311ab.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0CodeOnlyCustomActivitiesforAtomicAc_B180/image_abaeffc1-dc75-486f-add1-2cb7fe8311ab.png" width="333" height="153" /></p>  <h3>Adding Input Parameters to the Custom Activity</h3>  <p>To add a new input parameter to the activity, we declare a <strong>InArgument&lt;T&gt;</strong> field and property where T is the type of the parameter.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <div style="font-family: consolas; background: white; color: black; font-size: 11pt">     <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">OutputString</span> : <span style="color: #2b91af">CodeActivity</span></p>      <p style="margin: 0px">{</p>      <p style="margin: 0px">&#160; <strong><span style="color: #2b91af">InArgument</span>&lt;<span style="color: blue">string</span>&gt; name;</strong></p>      <p style="margin: 0px"><strong>&#160;</strong></p>      <p style="margin: 0px"><strong>&#160; <span style="color: blue">public</span> <span style="color: #2b91af">InArgument</span>&lt;<span style="color: blue">string</span>&gt; Name</strong></p>      <p style="margin: 0px"><strong>&#160; {</strong></p>      <p style="margin: 0px"><strong>&#160;&#160;&#160; <span style="color: blue">get </span></strong><strong>{ </strong><strong><span style="color: blue">return</span> name; </strong><strong>}</strong></p>      <p style="margin: 0px"><strong>&#160;&#160;&#160; <span style="color: blue">set </span></strong><strong>{</strong></p>      <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; ThrowIfOpen();</strong></p>      <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; name = <span style="color: blue">value</span>;</strong></p>      <p style="margin: 0px"><strong>&#160;&#160;&#160; }</strong></p>      <p style="margin: 0px"><strong>&#160; }</strong></p>      <p style="margin: 0px">&#160;</p>      <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">CodeActivityContext</span> context)</p>      <p style="margin: 0px">&#160; {</p>      <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">&quot;Hello,&#160; &quot;</span> + <strong><span style="color: blue">this</span>.Name.Get(context)</strong>);</p>      <p style="margin: 0px">&#160; }</p>      <p style="margin: 0px">}</p>   </div> </div>  <p>Note that in the property setter implementation I am calling the base class’ <strong>ThrowIfOpen()</strong> method. This method throws an InvalidOperationException if the activity has already been prepared for execution and the value cannot be set.</p>  <p>Also note that in order to get the property value, we do not store the value in a private member in the class, but instead – we use the <strong>InArgument</strong> class and using the <strong>Get</strong> method passing it the activity context.</p>  <h3>Output Parameters to Custom Activities</h3>  <p>Lets create a simple activity that reads the name from the console.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">ReadString</span> : <span style="color: #2b91af">CodeActivity</span></p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <strong><span style="color: #2b91af">OutArgument</span>&lt;<span style="color: blue">string</span>&gt; outputString;</strong></p>    <p style="margin: 0px"><strong>&#160;</strong></p>    <p style="margin: 0px"><strong>&#160; <span style="color: blue">public</span> <span style="color: #2b91af">OutArgument</span>&lt;<span style="color: blue">string</span>&gt; Output</strong></p>    <p style="margin: 0px"><strong>&#160; {</strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160; <span style="color: blue">get </span>{ <span style="color: blue">return</span> outputString; }</strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160; <span style="color: blue">set </span>{</strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; ThrowIfOpen();</strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160; outputString = <span style="color: blue">value</span>;</strong></p>    <p style="margin: 0px"><strong>&#160;&#160;&#160; }</strong></p>    <p style="margin: 0px"><strong>&#160; }</strong></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">CodeActivityContext</span> context)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">string</span> value = <span style="color: #2b91af">Console</span>.ReadLine();</p>    <p style="margin: 0px"><strong>&#160;&#160;&#160; context.SetValue(Output, value);</strong></p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">}</p> </div>  <p>Notice how the code required for an output argument is similar to the one required for an input argument. Also notice how we set the value back to the output value using the <strong>ActivityContext</strong> instance.</p>  <h3>Activities with a Single Output Parameter - CodeActivity&lt;T&gt;</h3>  <p>The above sample read a string from the console and placed the value in the output parameter. If this is the case we can also inherit from <strong>CodeActivity&lt;T&gt;</strong>:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">class</span> <span style="color: #2b91af">ReadString2</span> : <span style="color: #2b91af">CodeActivity</span>&lt;<span style="color: blue">string</span>&gt;</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> Execute(<span style="color: #2b91af">CodeActivityContext</span> context)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">string</span> value = <span style="color: #2b91af">Console</span>.ReadLine();</p>    <p style="margin: 0px">&#160;&#160;&#160; context.SetValue(<strong>Result</strong>, value);</p>    <p style="margin: 0px">&#160; }</p>    <p style="margin: 0px">}</p> </div>  <p>Inheriting from <strong>CodeActivity&lt;T&gt;</strong> makes it more simple to write a custom activity that has a single output parameter. It has additional benefits which I’ll talk about in a subsequent post.</p>  <h3>Summary</h3>  <p>In this post I talked about creating a <strong>code only custom activities</strong> that performs a simple task. I have also talked about input and output parameters.</p>]]></content:encoded>
    </item>
    <item>
      <title>WF 4.0: How to Execute a Worklflow (WorkflowInvoker vs WorkflowInstance)</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/wf-4-0-how-to-execute-a-worklflow-workflowinvoker-vs-workflowinstance</link>
      <pubDate>Tue, 19 May 2009 05:14:40 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/05/19/wf-4-0-how-to-execute-a-worklflow-workflowinvoker-vs-workflowinstance/</guid>
      <description><![CDATA[WF 4.0: How to Execute a Worklflow (WorkflowInvoker vs WorkflowInstance)  Note: This post is based...]]></description>
      <content:encoded><![CDATA[<h1>WF 4.0: How to Execute a Worklflow (WorkflowInvoker vs WorkflowInstance)</h1>  <p><strong>Note</strong>: This post is based on <a href="http://blogs.msdn.com/bursteg/Visual%20Studio%202010%20Beta%201">Visual Studio 2010 Beta 1</a> which is the latest version available in the time of writing this post, so by the time this technology ships, there are probably things that will be slight different.</p>  <p></p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Execute Worklflow (WorkflowInvoker WorkflowInstance" border="0" alt="Execute Worklflow (WorkflowInvoker WorkflowInstance" align="right" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0HowtoExecuteaWorklflow_D783/WF_ad3238a0-eed5-4642-8b0e-bfba44d3eccb.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0HowtoExecuteaWorklflow_D783/WF_ad3238a0-eed5-4642-8b0e-bfba44d3eccb.png" width="314" height="61" />There are two ways to execute a workflow:</p>  <ul>   <li>Using the <strong>WorkflowInstance</strong> class </li>    <li>Using the <strong>WorkflowInvoker</strong> class </li> </ul>  <h3>Execute Workflows using WorkflowInstace</h3>  <p>When you create a new <strong>Sequential Workflow Console Application</strong>, Visual Studio creates the basic code needed to execute the workflow inside the <strong>Main</strong> method:</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">static</span> <span style="color: blue">void</span> Main(<span style="color: blue">string</span>[] args)</p>    <p style="margin: 0px">{</p>    <p style="margin: 0px">&#160; <span style="color: #2b91af">AutoResetEvent</span> syncEvent = <span style="color: blue">new</span> <span style="color: #2b91af">AutoResetEvent</span>(<span style="color: blue">false</span>);</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; <span style="color: #2b91af">WorkflowInstance</span> myInstance = <span style="color: blue">new</span> <span style="color: #2b91af">WorkflowInstance</span>(<span style="color: blue">new</span> <span style="color: #2b91af">Sequence1</span>());</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; myInstance.OnCompleted = <span style="color: blue">delegate</span>(<span style="color: #2b91af">WorkflowCompletedEventArgs</span> e)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; syncEvent.Set();</p>    <p style="margin: 0px">&#160; };</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; myInstance.OnUnhandledException = <span style="color: blue">delegate</span>(<span style="color: #2b91af">WorkflowUnhandledExceptionEventArgs</span> e)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">Console</span>.WriteLine(e.UnhandledException.ToString());</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">return</span> <span style="color: #2b91af">UnhandledExceptionAction</span>.Terminate;</p>    <p style="margin: 0px">&#160; };</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; myInstance.OnAborted = <span style="color: blue">delegate</span>(<span style="color: #2b91af">WorkflowAbortedEventArgs</span> e)</p>    <p style="margin: 0px">&#160; {</p>    <p style="margin: 0px">&#160;&#160;&#160; <span style="color: #2b91af">Console</span>.WriteLine(e.Reason);</p>    <p style="margin: 0px">&#160;&#160;&#160; syncEvent.Set();</p>    <p style="margin: 0px">&#160; };</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; myInstance.Run();</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160; syncEvent.WaitOne();</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">}</p> </div>  <p>1. A <strong>workflow instance</strong> is created and gets a reference to the root activity of the workflow. The <strong>WorkflowInstance</strong> class lets us control the running instance of the workflow and exposes several methods for this such as Run(), Abort(), Cancel(), Load(), Unload etc.</p>  <p>2. Since the workflow execution is scheduled to another thread, we need to block the main thread until the workflow is completed or terminated. To do this, we:</p>  <ul>   <li>Create an <strong>AutoResetEvent</strong> initialized to false, </li>    <li>Set the event to true when the workflow is completed, and </li>    <li>In the main thread - wait for the workflow to complete before exiting the method. </li> </ul>  <p>3. In order to handle errors in the workflow such as exceptions or termination, in addition to handling the <strong>OnCompleted</strong> event, we are also handling the <strong>OnHandledException</strong> and <strong>OnAborted</strong> events. Note that when the workflow has an unhandled exception, the program can still decide how it wants to end the workflow execution, whether it is by aborting, cancelling or terminating the workflow. If the workflow is terminated, the OnCompleted event will also be raised.</p>  <h3>Execute Workflows using WorkflowInvoker</h3>  <p><strong>WorkflowInvoker</strong> lets you invoke a workflow much more easily than the previous approach. It takes the instance of the workflow or activity to run and executes it synchronously. </p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: #2b91af">WorkflowInvoker</span>.Invoke(<span style="color: blue">new</span> <span style="color: #2b91af">Sequence1</span>());</p> </div>  <p>There are additional overloads of this method that takes parameters and a TimeSpan in which the workflow should complete within. I’ll talk in more details about passing parameters to workflow in a subsequent post, but in general this is all we have to know about <strong>WorkflowInvoker</strong>.</p>  <h3>Choosing between WorkflowInstance and WorkflowInvoker</h3>  <p>If you have a simple workflow that should run synchronously – use <strong>WorkflowInvoker</strong>. This is useful also in when unit testing workflows (more on this in a later post).</p>  <p>If you have a <strong>long running workflow</strong> that you want to control – persist, abort, cancel etc – use <strong>WorkflowInstance</strong>.</p>  <p>Enjoy!</p>]]></content:encoded>
    </item>
    <item>
      <title>WF 4.0: Building a Hello World Sequential Workflow</title>
      <link>https://docs.microsoft.com/archive/blogs/bursteg/wf-4-0-building-a-hello-world-sequential-workflow</link>
      <pubDate>Tue, 19 May 2009 05:10:45 GMT</pubDate>
      <dc:creator><![CDATA[Guy Burstein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bursteg/2009/05/19/wf-4-0-building-a-hello-world-sequential-workflow/</guid>
      <description><![CDATA[WF 4.0: Building a Hello World Sequential Workflow    Note: This post is based on Visual Studio 2010...]]></description>
      <content:encoded><![CDATA[<h1>WF 4.0: Building a Hello World Sequential Workflow</h1>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/WF_ef7c5682-700d-4d29-8c62-27a8b04ed7d7.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/WF_ef7c5682-700d-4d29-8c62-27a8b04ed7d7.png" width="314" height="61" /></p>  <p><strong>Note</strong>: This post is based on <font color="#ff0000"><a href="Visual Studio 2010 Beta 1">Visual Studio 2010 Beta 1</a></font> which is the latest version available in the time of writing this post, so by the time this technology ships, there are probably things that will be slight different.</p>  <p>Start <font color="#ff0000"><a href="Visual Studio 2010 Beta 1">Visual Studio 2010 Beta 1</a></font> and create a new <strong>Sequential Workflow Console Application.</strong></p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_df297f03-d0a5-483b-9d2d-b194278808e2.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_df297f03-d0a5-483b-9d2d-b194278808e2.png" width="480" height="332" /> </p>  <p>After you click OK, visual studio creates the new projects and creates a new WF project, in which there are some things you should know about:</p>  <p><strong><img style="border-right-width: 0px; margin: 0px 0px 45px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" align="right" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_dc978f71-2b47-4720-9c0f-e973e331ddca.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_dc978f71-2b47-4720-9c0f-e973e331ddca.png" width="202" height="320" />References</strong>:</p>  <ul>   <li><strong>System.Xaml</strong> – Now that there are several technologies based on Xaml, this is a new Assembly in .Net Framework 4.0 that contains Xaml services such as serialization. </li>    <li><strong>System.Activities</strong> is the assembly that contains the implementation of WF 4.0, and as you can guess, the corresponding namespace is System.Activities and anything beneath it. </li>    <li><strong>System.Activities.Design</strong> contains the designers for the activities and the designer re-hosting implementation. Since the new designer is based on WPF, you can also note references to <strong>WindowsBase</strong>, <strong>PresentationCode</strong> and <strong>PresentationFramework</strong>. </li>    <li><strong>System.ServiceModel</strong> contains WCF implementation (as of .Net Framework 3.0) and now <strong>System.ServiceModel.Activities</strong> contains the activities used for Workflow Services (the integration between WF and WCF). </li> </ul>  <p><strong>Sequence.xaml</strong>:</p>  <p>By default, workflows are created declaratively in WF 4.0 and represented in <strong>.xaml files with no code behind</strong>. If you open this file with an Xml editor, you will see it clearly.</p>  <div style="font-family: consolas; background: white; color: black; font-size: 11pt">   <p style="margin: 0px"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml</span><span style="color: blue"> </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot;<span style="color: blue"> </span><span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot;<span style="color: blue"> ?&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">p:Activity</span><span style="color: blue"> </span><span style="color: red">x:Class</span><span style="color: blue">=</span>&quot;<span style="color: blue">HelloWorld.Sequence1</span>&quot;</p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">xmlns:p</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/netfx/2009/xaml/activities</span>&quot;</p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">xmlns:s</span><span style="color: blue">=</span>&quot;<span style="color: blue">clr-namespace:System;assembly=mscorlib</span>&quot;</p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">xmlns:sad</span><span style="color: blue">=</span>&quot;<span style="color: blue">clr-namespace:System.Activities.Debugger;assembly=System.Activities</span>&quot;</p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">xmlns:sadx</span><span style="color: blue">=</span>&quot;<span style="color: blue">clr-namespace:System.Activities.Design.Xaml;assembly=System.Activities.Design</span>&quot;</p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">xmlns:x</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/winfx/2006/xaml</span>&quot;<span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;</span><span style="color: #a31515">p:Sequence</span><span style="color: blue"> </span><span style="color: red">sad:XamlDebuggerXmlReader.FileName</span><span style="color: blue">=</span>&quot;<span style="color: blue">C:\...\HelloWorld\Sequence1.xaml</span>&quot;<span style="color: blue">&gt;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="color: blue">&#160;&#160;&#160; &lt;/</span><span style="color: #a31515">p:Sequence</span><span style="color: blue">&gt;</span></p>    <p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">p:Activity</span><span style="color: blue">&gt;</span></p> </div>  <p>The new WF Designer shows an empty sequence, representing an empty block of execution. Note the warning sign that says that the sequence has no child activities.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_e5f1f87b-fb12-4ca7-8c57-831e23a64e66.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_e5f1f87b-fb12-4ca7-8c57-831e23a64e66.png" width="251" height="231" /> </p>  <p>From the <strong>Procedural</strong> section in the <strong>Toolbox</strong>, drag the <strong>WriteLine</strong> Activity to the design surface. </p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_b37a9769-f994-489e-92f1-5f197935c050.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_b37a9769-f994-489e-92f1-5f197935c050.png" width="259" height="213" /> </p>  <p>Now, you get a warning that the <strong>Text</strong> property is not set. To set it, go the properties window, and open the <strong>Expression Editor</strong>. In WF 4.0 you use the Expression to set values to variables and parameters, and you can use either static values (like in this case) or VB. <strong>Yes! Expression are written in VB</strong>. </p>  <p>Type the text you want to display to the console and click OK.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_a55edc5b-969b-4248-90c7-6ffba4770792.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_a55edc5b-969b-4248-90c7-6ffba4770792.png" width="450" height="273" /> </p>  <p>Now, that the simple workflow is completed, you can use Ctrl + F5 to run it like you normally do.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_cefd08b7-090b-4f36-92ad-4f63b204792f.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_cefd08b7-090b-4f36-92ad-4f63b204792f.png" width="480" height="250" /> </p>  <h3>Debugging a Workflow</h3>  <p>The debugging experience when debugging a workflow in WF 4.0 is very similar to the debugging experience when using code. You can right click an activity the in designer and select <strong>Insert Breakpoint</strong>, or use <strong>F9</strong> to do this.</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_fafdf8e7-f0ae-466f-878e-f952b2397b42.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_fafdf8e7-f0ae-466f-878e-f952b2397b42.png" width="480" height="392" /> </p>  <p>Once you do this and run the workflow, the debugger highlights the current activity using a yellow border (similar to the yellow background for the current statement when debugging code).</p>  <p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WF 4.0 Hello World Sequential Workflow" border="0" alt="WF 4.0 Hello World Sequential Workflow" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_1164933d-d9bf-47e4-95b5-aa30be08d7d6.png" original-url="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/WF4.0BuildingaHelloWorldSequentialWorkfl_CBBD/image_1164933d-d9bf-47e4-95b5-aa30be08d7d6.png" width="243" height="184" /> </p>  <p>Enjoy!</p>]]></content:encoded>
    </item>
  </channel>
</rss>