<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Team Foundation Server Team Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/team_foundation/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/team_foundation/feed.xml</link>
    <description>Application Lifecycle Management with Visual Studio Team Foundation Server</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:27:17 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Process Template Schemas Published to Code Gallery</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/process-template-schemas-published-to-code-gallery</link>
      <pubDate>Tue, 18 Jan 2011 08:51:17 GMT</pubDate>
      <dc:creator><![CDATA[jontsao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2011/01/18/process-template-schemas-published-to-code-gallery/</guid>
      <description><![CDATA[Allen Clark has published the Team Foundation Server process template schema files to Code Gallery:...]]></description>
      <content:encoded><![CDATA[<p>Allen Clark has published the Team Foundation Server process template schema files to Code Gallery: <a href="https://code.msdn.microsoft.com/TFSchemas">https://code.msdn.microsoft.com/TFSchemas</a>. Check out <a href="https://blogs.msdn.com/b/allclark/archive/2011/01/13/using-the-schemas-to-edit-work-item-types-and-process-tempalates-for-team-foundation-in-visual-studio.aspx">his blog post</a> for a short helpful guide on how to use them to help you when you’re customizing your process templates.</p>]]></content:encoded>
    </item>
    <item>
      <title>Programming for the TFS Excel Add-in</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/programming-for-the-tfs-excel-add-in</link>
      <pubDate>Sat, 06 Nov 2010 08:45:19 GMT</pubDate>
      <dc:creator><![CDATA[John Nierenberg_Bing]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/11/06/programming-for-the-tfs-excel-add-in/</guid>
      <description><![CDATA[&#160;  Some folks have asked about how to program against the TFS Excel Add-In. The summary is that...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Some folks have asked about how to program against the TFS Excel Add-In. The summary is that we don’t have a public API for the TFS Add-in but we do support using the ribbon.</p>  <p>Here are the ribbon commands and an example of how to use them.</p>  <p><b>List of control tags for TFS Excel Add-In </b>    <table border="0" cellspacing="0" cellpadding="0"><tbody>       <tr>         <td width="246">           <p><b>Control</b></p>         </td>          <td width="114">           <p><b>Tag</b></p>         </td>       </tr>        <tr>         <td width="246">           <p>Team menu</p>         </td>          <td width="114">           <p>IDC_WORK_ITEMS_MENU</p>         </td>       </tr>        <tr>         <td width="246">           <p>New List</p>         </td>          <td width="114">           <p>IDC_NEW_WI_LIST</p>         </td>       </tr>        <tr>         <td width="246">           <p>Get Work Items</p>         </td>          <td width="114">           <p>IDC_IMPORT</p>         </td>       </tr>        <tr>         <td width="246">           <p>Publish</p>         </td>          <td width="114">           <p>IDC_SYNC</p>         </td>       </tr>        <tr>         <td width="246">           <p>Refresh</p>         </td>          <td width="114">           <p>IDC_REFRESH</p>         </td>       </tr>        <tr>         <td width="246">           <p>Configure List</p>         </td>          <td width="114">           <p>IDC_CONFIGURE_LIST</p>         </td>       </tr>        <tr>         <td width="246">           <p>Choose Columns</p>         </td>          <td width="114">           <p>IDC_COLUMN_CHOOSER</p>         </td>       </tr>        <tr>         <td width="246">           <p>Links and Attachments</p>         </td>          <td width="114">           <p>IDC_LINKS_ATTACHMENTS</p>         </td>       </tr>        <tr>         <td width="246">           <p>Edit Areas and Iterations (menu)</p>         </td>          <td width="114">           <p>IDC_CSSEDIT</p>         </td>       </tr>        <tr>         <td width="246">           <p>Server Connection</p>         </td>          <td width="114">           <p>IDC_CONFIGURE_MENU&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>         </td>       </tr>        <tr>         <td width="246">           <p>Open in Web Access</p>         </td>          <td width="114">           <p>IDC_OPEN_IN_WEB_ACCESS&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>         </td>       </tr>        <tr>         <td width="246">           <p>Process Guidance</p>         </td>          <td width="114">           <p>IDC_PROCESS_GUIDANCE&#160;&#160; </p>         </td>       </tr>        <tr>         <td width="246">           <p>Project Portal</p>         </td>          <td width="114">           <p>IDC_PROJECT_PORTAL&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>         </td>       </tr>        <tr>         <td width="246">           <p>Team Foundation Help</p>         </td>          <td width="114">           <p>IDC_VSTS_HELP&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>         </td>       </tr>     </tbody></table> </p>  <p><strong>Here is how you find the Team command bar for and loop through the controls:</strong></p>  <blockquote>   <p>Private Function FindTeamControl(tagName As String) As CommandBarControl</p>    <p>&#160;&#160;&#160; Dim commandBar As commandBar</p>    <p>&#160;&#160;&#160; Dim teamCommandBar As commandBar</p>    <p>&#160;&#160;&#160; Dim control As CommandBarControl</p>    <p>&#160;&#160;&#160; For Each commandBar In Application.CommandBars</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; If commandBar.Name = &quot;Team&quot; Then</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Set teamCommandBar = commandBar</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Exit For</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; End If</p>    <p>&#160;&#160;&#160; Next</p>    <p>&#160;&#160;&#160; If Not teamCommandBar Is Nothing Then</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; For Each control In teamCommandBar.Controls</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; If InStr(1, control.tag, tagName) Then</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Set FindTeamControl = control</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Exit Function</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; End If</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Next</p>    <p>&#160;&#160;&#160; End If</p>    <p>End Function</p> </blockquote>  <p><strong>Here is an example of refreshing: </strong></p>  <blockquote>   <p>Private Function RefreshTeamQuery(rangeName As String)</p>    <p>&#160;&#160;&#160; Dim activeSheet As Worksheet</p>    <p>&#160;&#160;&#160; Dim teamQueryRange As range</p>    <p>&#160;&#160;&#160; Dim refreshControl As CommandBarControl</p>    <p>&#160;&#160;&#160; Set refreshControl = FindTeamControl(&quot;IDC_REFRESH&quot;)</p>    <p>&#160;&#160;&#160; If refreshControl Is Nothing Then</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; MsgBox &quot;Could not find Team Foundation commands in Ribbon. Please make sure that the Team Foundation Excel plugin is installed.&quot;, vbCritical</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Exit Function</p>    <p>&#160;&#160;&#160; End If</p>    <p>&#160;&#160;&#160; ' Disable screen updating temporarily so that the user doesn't see us selecting a range</p>    <p>&#160;&#160;&#160; Application.ScreenUpdating = False</p>    <p>&#160;&#160;&#160; ' Capture the currently active sheet, we will need it later</p>    <p>&#160;&#160;&#160; Set activeSheet = ActiveWorkbook.activeSheet</p>    <p>&#160;&#160;&#160; Set teamQueryRange = range(rangeName)</p>    <p>&#160;&#160;&#160; teamQueryRange.Worksheet.Select</p>    <p>&#160;&#160;&#160; teamQueryRange.Select</p>    <p>&#160;&#160;&#160; refreshControl.Execute</p>    <p>&#160;&#160;&#160; activeSheet.Select</p>    <p>&#160;&#160;&#160; Application.ScreenUpdating = True</p>    <p>End Function</p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>Tool to configure SharePoint Server for dashboard compatibility with Team Foundation Server 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/tool-to-configure-sharepoint-server-for-dashboard-compatibility-with-team-foundation-server-2010</link>
      <pubDate>Sat, 07 Aug 2010 16:04:00 GMT</pubDate>
      <dc:creator><![CDATA[Smitha Saligrama- MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/08/07/tool-to-configure-sharepoint-server-for-dashboard-compatibility-with-team-foundation-server-2010/</guid>
      <description><![CDATA[If you have&nbsp;or planing to have Team foundation server 2010 integration with SharePoint...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal"><span style="font-family: times new roman,times;"><span style="font-size: small;">If you have&nbsp;or planing to have Team foundation server 2010 integration with SharePoint Server(MOSS) and</span></span><span style="font-family: times new roman,times;"><span style="font-size: small;">&nbsp;unsure of the SharePoint configurations needed to get the dashboards(Tfs Excel reports that show as dashboards in team project portal site)&nbsp;working,</span></span></p>
<p class="MsoNormal"><span style="font-family: times new roman,times;"><span style="font-size: small;">Then here is a tool for you.</span></span></p>
<p class="MsoNormal"><span style="font-family: times new roman,times;"><span style="font-size: small;"></span></span></p>
<p class="MsoNormal"><span style="font-family: times new roman,times;"><span style="font-size: small;"></span></span></p>
<p class="MsoListParagraphCxSpFirst"><span style="font-size: x-small;"><span style="font-family: times new roman,times;"><span style="font-size: small;"><b style="mso-bidi-font-weight: normal"><span style="mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt; mso-bidi-language: AR-SA;">Microsoft Team Foundation Server 2010 MOSS Configuration Tool </span></b><span style="mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt; mso-bidi-language: AR-SA;"><a href="https://visualstudiogallery.msdn.microsoft.com/en-us/db469790-5e3e-42f3-906e-411a73795a1b"><span style="mso-bidi-font-weight: bold; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">https://visualstudiogallery.msdn.microsoft.com/en-us/db469790-5e3e-42f3-906e-411a73795a1b</span></a><o:p></o:p></span></span></span></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt; mso-bidi-language: AR-SA;"><o:p style="FONT-FAMILY: "><span style="font-family: times new roman,times;"><span style="font-size: small;">&nbsp;</span></span></o:p></span><span style="mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt; mso-bidi-language: AR-SA;"><span style="font-size: x-small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">When you download from the above link it will just copy the tool(and help documentation)&nbsp;to the selected folder.</span></span></span></span></p>
<p class="MsoNormal"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: x-small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">The tool configures an existing installation of Microsoft Office SharePoint Server 2007 or Microsoft SharePoint Server 2010 for use with Microsoft Visual Studio 2010 Team Foundation Server.&nbsp;The configuration tool is designed to configure relatively simple deployments of Office SharePoint Server 2007 or SharePoint Server 2010. The tool uses default values to configure the features.<o:p></o:p></span></span></span></span></p>
<p class="MsoNormal"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: x-small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">The tool configures the following features in <o:p></o:p></span></span></span></span></p>
<p class="MsoNormal"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: x-small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">Office SharePoint Server 2007:<o:p></o:p></span></span></span></span></p>
<ul type="disc" style="MARGIN-TOP: 0in">
<li class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">Shared Service Provider (SSP) <o:p></o:p></span></span></span></span></li>
<li class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">Excel Services <o:p></o:p></span></span></span></span></li>
<li class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">Single Sign-on<o:p></o:p></span></span></span></span></li>
</ul>
<p class="MsoNormalCxSpMiddle"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><o:p style="FONT-FAMILY: "><span style="font-family: times new roman,times;"><span style="font-size: small;"></span></span></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: x-small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">SharePoint Server 2010:<o:p></o:p></span></span></span></span></p>
<ul type="disc" style="MARGIN-TOP: 0in">
<li class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">Excel Services<o:p></o:p></span></span></span></span></li>
<li class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">Secure Store Service</span></span></span></span></li>
</ul>
<p class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;"><strong>When To Run the Tool?</strong></span></span></span></span></p>
<ol>
<li>
<div class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">SharePoint Server (2007 or 2010) installed and configured</span></span></span></span></div>
</li>
<li>
<div class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">Team Foundation Server 2010 installed and configured (Integrated with SharePoint Server install in Step 1)</span></span></span></span></div>
</li>
<li>
<div class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">Run the tool on SharePoint Server machine. </span></span></span></span></div>
</li>
</ol>
<p class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;"></span></span></span></span><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">The tool does not depend on Team Foundation Server installation, so you can run the tool after Step 1. above, but you will need below 2 accounts from the Team Foundation Server 2010 installation, which is also mentioned in the Pre-requisite section of the help document.</span></span></span></span></p>
<ol>
<li>
<div class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">A domain group account of all users of Team Foundation Server who will require access to the team portal (PortalUsers)</span></span></span></span></div>
</li>
<li>
<div class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">The data sources reader account for Team Foundation Server (referred to in the documentation as TFSReports)</span></span></span></span></div>
</li>
</ol>
<p class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;"></span></span></span></span></p>
<p class="MsoNormalCxSpMiddle" style="LINE-HEIGHT: normal; MARGIN: 6pt auto; mso-add-space: auto; mso-list: l0 level1 lfo1"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;">If you give it a try, Please let me know how it went.</span></span></span></span></p>
<p class="MsoNormalCxSpMiddle"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;"></span></span></span></span></p>
<p class="MsoNormalCxSpMiddle"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: small;"><span style="font-family: times new roman,times;"><span style="font-size: small;"></span></span></span></span></p>
<p class="MsoNormal"><span style="font-family: times new roman,times;"><span style="font-size: small;"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: AR-SA;"><span style="font-size: x-small;"><o:p></o:p></span></span></span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Visualizing Team Foundation Server Work Items with Live Labs Pivot</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/visualizing-team-foundation-server-work-items-with-live-labs-pivot</link>
      <pubDate>Thu, 08 Jul 2010 16:29:17 GMT</pubDate>
      <dc:creator><![CDATA[jontsao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/07/08/visualizing-team-foundation-server-work-items-with-live-labs-pivot/</guid>
      <description><![CDATA[Live Labs Pivot is a great way to visualize sets of data, and glean insights/understand patterns...]]></description>
      <content:encoded><![CDATA[<p><a href="https://www.getpivot.com/">Live Labs Pivot</a> is a great way to visualize sets of data, and glean insights/understand patterns that may not be as visible otherwise. In this post, we’ll walk through how easy it is to visualize Team Foundation Server work items using Live Labs Pivot.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5657.image_0240E1FB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5657.image_5F00_0240E1FB.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5164.image_thumb_7ECF2485.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5164.image_5F00_thumb_5F00_7ECF2485.png" width="565" height="371" /></a></p>  <h2>Prerequisites</h2>  <p>For the purposes of this walkthrough, you’ll need the following:</p>  <ul>   <li><a href="https://www.getpivot.com/download/">Live Labs Pivot</a></li>    <li>Microsoft Office Excel (2007 or 2010) </li>    <li><a href="https://www.getpivot.com/developer-info/download-excel-tools.aspx">Pivot Collection Tool for Microsoft Excel</a> - The sets of data that Pivot can visualize are called “<a href="https://www.getpivot.com/developer-info/">Collections</a>”. There are various ways you can create collections, but the easiest for the purposes of this walkthrough is to just use Excel. The Pivot Collection Tool for Microsoft Excel is an add-in that makes it easy to create collections from data in Excel.</li>    <li>Access to a Team Foundation Server (you can use TFS’s Excel add-in to easily pull in work items into Excel).</li> </ul>  <h2>Creating the collection</h2>  <p>Open Excel, and on the Pivot Collections tab in the ribbon, create a New Collection.</p> <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/2352.image_5577DC87.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/2352.image_5F00_5577DC87.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/2055.image_thumb_4256AFDB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/2055.image_5F00_thumb_5F00_4256AFDB.png" width="540" height="87" /></a>  <br />  <p>In the resulting workbook that’s created, you’ll see a blank table with some column headings. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/6558.image_1AB033B1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/6558.image_5F00_1AB033B1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/1778.image_thumb_01483077.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/1778.image_5F00_thumb_5F00_01483077.png" width="539" height="144" /></a></p>  <p>Of particular importance are “Name” and “Description”. These appear at the top of the Info Panel when you’ve zoomed in to an item in the collection:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/3750.image_52EEAAC9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/3750.image_5F00_52EEAAC9.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5504.image_thumb_446388D7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5504.image_5F00_thumb_5F00_446388D7.png" width="543" height="336" /></a></p>  <p>As you can see, these map well to the Title and Description fields in a work item (or if you’re looking at bug work items, the Repro Steps field).</p>  <p>Next, copy and paste work items into the blank table (you can run query in Visual Studio and copy the results you want into Excel, or in a new sheet, import work items using the TFS Excel add-in and copy those results over). Be sure to choose columns that you want to see/analyze in Pivot. For example, if I’m analyzing the active bugs in the current iteration, I might want to see who they are assigned to, the priorities, and the area path:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5428.image_6D1EEE20.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5428.image_5F00_6D1EEE20.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/3463.image_thumb_5A69F469.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/3463.image_5F00_thumb_5F00_5A69F469.png" width="546" height="307" /></a></p>  <p>Notice that I’ve renamed Title to Name and Repro Steps to Description above so that Pivot recognizes these columns.</p>  <h2>Previewing the collection</h2>  <p>On the Pivot Collections tab in the ribbon, click the Quick Preview button (note, you must select a cell in the table for this option to be enabled):</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/6082.image_23AC9965.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/6082.image_5F00_23AC9965.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/8662.image_thumb_10F79FAE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/8662.image_5F00_thumb_5F00_10F79FAE.png" width="545" height="92" /></a></p>  <p>This should fire up Pivot and display the work items with some filter options on the left:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/6114.image_7723697E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/6114.image_5F00_7723697E.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/7510.image_thumb_43B78055.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/7510.image_5F00_thumb_5F00_43B78055.png" width="553" height="363" /></a></p>  <p>Start exploring and analyzing your work items! </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/1665.image_2FBDEDBF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/1665.image_5F00_2FBDEDBF.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5481.image_thumb_65DF660E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5481.image_5F00_thumb_5F00_65DF660E.png" width="552" height="370" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/0601.image_2B17BD38.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/0601.image_5F00_2B17BD38.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/1780.image_thumb_6713D920.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/1780.image_5F00_thumb_5F00_6713D920.png" width="552" height="303" /></a></p>  <h2>Adding images</h2>  <p>For each data point, Pivot assumes that there is some sort of image that can represent it. For the purposes of this walkthrough, I’m most interested in the priority of the bugs, so I’ve kept things simple and chosen simple colored squares to represent work items based on their priority. </p>    <table border="0" cellspacing="0" cellpadding="2" width="400"><tbody>     <tr>       <td valign="top" width="100"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/3348.RedSquare_6C8249C4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/3348.RedSquare_5F00_6C8249C4.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="RedSquare" border="0" alt="RedSquare" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/1185.RedSquare_thumb_30567E1C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/1185.RedSquare_5F00_thumb_5F00_30567E1C.png" width="20" height="20" /></a></td>        <td valign="top" width="100"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/8055.OrangeSquare3_4BFB0A12.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/8055.OrangeSquare3_5F00_4BFB0A12.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="OrangeSquare[3]" border="0" alt="OrangeSquare[3]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5315.OrangeSquare3_thumb_0FCF3E6A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5315.OrangeSquare3_5F00_thumb_5F00_0FCF3E6A.png" width="20" height="20" /></a></td>        <td valign="top" width="100"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5808.YellowSquare3_648AA762.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5808.YellowSquare3_5F00_648AA762.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="YellowSquare[3]" border="0" alt="YellowSquare[3]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/8535.YellowSquare3_thumb_3D505E2D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/8535.YellowSquare3_5F00_thumb_5F00_3D505E2D.png" width="20" height="20" /></a></td>        <td valign="top" width="100"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/1373.GreenSquare3_641E746D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/1373.GreenSquare3_5F00_641E746D.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="GreenSquare[3]" border="0" alt="GreenSquare[3]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/7462.GreenSquare3_thumb_0AEC8AAE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/7462.GreenSquare3_5F00_thumb_5F00_0AEC8AAE.png" width="20" height="20" /></a></td>     </tr>      <tr>       <td valign="top" width="100">Pri 1</td>        <td valign="top" width="100">Pri 2</td>        <td valign="top" width="100">Pri 3</td>        <td valign="top" width="100">Pri 4</td>     </tr>   </tbody></table>  <br />    <p>To choose an image to represent an item in a Pivot collection, go back to the Excel workbook, select one of the item’s cells, and click on the Choose Image button on the Pivot Collections tab on the Ribbon:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/7043.image_63B24178.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/7043.image_5F00_63B24178.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/2287.image_thumb_0E1E7296.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/2287.image_5F00_thumb_5F00_0E1E7296.png" width="553" height="98" /></a></p>  <p>Finally, publish the collection to see the images:</p>   <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/6404.image_7AFD45E9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/6404.image_5F00_7AFD45E9.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/4341.image_thumb_29FF81C1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/4341.image_5F00_thumb_5F00_29FF81C1.png" width="557" height="294" /></a>]]></content:encoded>
    </item>
    <item>
      <title>WIQL syntax for Link Query</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/wiql-syntax-for-link-query</link>
      <pubDate>Fri, 02 Jul 2010 13:51:00 GMT</pubDate>
      <dc:creator><![CDATA[Smitha Saligrama- MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/07/02/wiql-syntax-for-link-query/</guid>
      <description><![CDATA[Flat List Query (Old)
The general Syntax:
select &lt;fields&gt; from WorkItems [where...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; color: #244061; font-size: 14pt; mso-themecolor: accent1; mso-themeshade: 128;">Flat List Query (Old)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">The general Syntax:<o:p></o:p></span></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;">select</span></span></b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;"> &lt;fields&gt; <b>from</b> WorkItems [<b>where</b> &lt;condition&gt;]<br />[<b>order by</b> &lt;fields&gt;] [<b>asof</b> &lt;date&gt;]<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; color: #244061; font-size: 14pt; mso-themecolor: accent1; mso-themeshade: 128;">Link Query<o:p></o:p></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><span style="font-family: Calibri; font-size: small;">When querying across links, you specify three filters:</span></p>
<p class="MsoNoSpacing" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2;"><span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size: small;">&middot;</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: Calibri; font-size: small;">A filter on the work items (<b style="mso-bidi-font-weight: normal;">Source</b>)</span></p>
<p class="MsoNoSpacing" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2;"><span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size: small;">&middot;</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: Calibri; font-size: small;">A filter on the links themselves (<b style="mso-bidi-font-weight: normal;">Link</b>)</span></p>
<p class="MsoNoSpacing" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2;"><span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size: small;">&middot;</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: Calibri; font-size: small;">A filter on the items being pointed to by the links (<b style="mso-bidi-font-weight: normal;">Target</b>)</span></p>
<h1 style="margin: 24pt 0in 0pt;"><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-spacerun: yes;"><span style="color: #365f91;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; color: #00b0f0; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;">Work Items</span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #365f91;"> --------&gt; </span></span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; color: #daa600; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;">Links</span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #365f91;"> ----------&gt; </span></span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; color: #00b050; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;">Linked Work Items<o:p></o:p></span></h1>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; color: #244061; font-size: 14pt; mso-themecolor: accent1; mso-themeshade: 128;">Work Items and Direct Links Query (One Hop Query)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><strong><span style="font-family: 'Calibri','sans-serif'; font-weight: normal; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-bidi-font-weight: bold;"><span style="font-size: small;">The general syntax:<o:p></o:p></span></span></strong></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="color: #333399;"><b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;">select</span></b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"> &lt;fields&gt; <b>from</b> </span></span><b><span style="font-family: 'Calibri','sans-serif'; color: #993300; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;">WorkItemLinks</span></b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;"> [<b>where</b> &lt;condition&gt;]<br />[<b>order by</b> &lt;fields&gt;] [<b>asof</b> &lt;date&gt;] [<b>mode(mustcontain|maycontain|doesnotcontain</b>)]<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-size: small;"><span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-language: RU;">Example</span></b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-language: RU;">:</span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p></o:p></span></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="color: #333399;"><b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;">select </span></b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;">*<b> from </b>WorkItemLinks <b>where <o:p></o:p></b></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="font-family: 'Calibri','sans-serif'; background: aqua; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-highlight: aqua;"><span style="color: #333399;">([Source].[System.WorkItemType] = &lsquo;Feature&rsquo; <b style="mso-bidi-font-weight: normal;">and</b> [Source].[System.State] = &lsquo;Active&rsquo;)</span></span><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;"> <b style="mso-bidi-font-weight: normal;">and</b></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;">&nbsp;<span style="background: yellow; mso-highlight: yellow;">([System.Links.LinkType] = &lsquo;System.LinkTypes.Dependency-Forward&rsquo;)</span> <b style="mso-bidi-font-weight: normal;">and</b></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;">&nbsp;<span style="background: lime; mso-highlight: lime;">(([Target].[System.WorkItemType = &lsquo;Bug&rsquo; <b style="mso-bidi-font-weight: normal;">and</b> [Target].[System.AssignedTo] = @me)</span> <b style="mso-bidi-font-weight: normal;">order by</b> [System.Id] <b style="mso-bidi-font-weight: normal;">mode(mustcontain)</b><br style="mso-special-character: line-break;" /><br style="mso-special-character: line-break;" />
<p><o:p></o:p></p>
</span></span>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-language: RU;"><span style="font-size: small;"><span style="font-family: Calibri;">The query will return all active features, which have bugs, assigned to me.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-language: RU;"><span style="font-size: small;"><span style="font-family: Calibri;">&lt;table&gt;<o:p></o:p></span></span></span></b></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-language: RU;"><span style="font-size: small;"><span style="font-family: Calibri;">The main difference is that we are querying from <b>WorkItemLinks</b>, which makes clear separation between regular queries and link queries.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-language: RU;"><span style="font-size: small;"><span style="font-family: Calibri;">&lt;condition&gt;<o:p></o:p></span></span></span></b></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-language: RU;">The <b>"where</b>" clause, only supports 3 separate sections separated by "<b>and</b>" operator: <br /><br />&nbsp;&nbsp;&nbsp; <span style="background: aqua; mso-highlight: aqua;">&lt;source expression&gt;</span> <b>and </b><span style="background: yellow; mso-highlight: yellow;">&lt;link expression&gt;</span> <b>and </b><span style="background: lime; mso-highlight: lime;">&lt;target expression&gt;</span><br /><br />where any of them is optional, and they can be in any order.<br style="mso-special-character: line-break;" /><br style="mso-special-character: line-break;" /></span><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p></o:p></span></b></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">&lt;mode&gt;<o:p></o:p></span></span></span></b></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">The default mode is &ldquo;<b>MustContain</b>&rdquo;, which means that we return links satisfying the criteria, and only them.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">The <b>MayContain</b> mode return links satisfying the criteria, but also return items, which satisfy just the source criteria, when target criteria is optional.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">The <b>DoesNotContain</b> mode return items, which does not have links specifying by target criteria. <o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; color: #244061; font-size: 14pt; mso-themecolor: accent1; mso-themeshade: 128;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; color: #244061; font-size: 14pt; mso-themecolor: accent1; mso-themeshade: 128;">Tree Query<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">The general syntax:<o:p></o:p></span></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;">select</span></span></b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;"> &lt;fields&gt; <b>from</b> WorkItemLinks [<b>where</b> &lt;condition&gt;]<br /><b>mode</b>(<b>recursive)</b><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Example:<o:p></o:p></span></span></span></b></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="color: #333399;"><b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;">select</span></b><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"> * <b>from</b> WorkItemLinks <b>where</b> <o:p></o:p></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="color: #333399;"><span style="font-family: 'Calibri','sans-serif'; background: aqua; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-highlight: aqua;">([Source].[System.State] = &lsquo;Resolved&rsquo;)</span><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"> <b style="mso-bidi-font-weight: normal;">and</b> <o:p></o:p></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="color: #333399;"><span style="font-family: 'Calibri','sans-serif'; background: yellow; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-highlight: yellow;">([Target].[System.State] = &lsquo;Resolved&rsquo;)</span><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"> <b style="mso-bidi-font-weight: normal;">and</b> <o:p></o:p></span></span></p>
<p class="CodeDisplay" style="margin: 6pt 0in 6pt 0.25in;"><span style="font-family: 'Calibri','sans-serif'; background: lime; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-highlight: lime;"><span style="color: #333399;">([System.Links.LinkType] = &lsquo;System.LinkTypes.Hierarchy-Forward&rsquo;</span></span><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="color: #333399;">) <b style="mso-bidi-font-weight: normal;">mode(recursive)</b><br style="mso-special-character: line-break;" /><br style="mso-special-character: line-break;" /><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-language: RU;"><span style="font-family: Calibri;"><span style="font-size: small;">&lt;table&gt;<o:p></o:p></span></span></span></b></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><span style="font-size: small;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-spacerun: yes;">&nbsp;</span></span></b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Same has One Hop Query.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;"><span style="font-size: small;">&lt;condition&gt;<o:p></o:p></span></span></span></b></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;"><span style="font-size: small;">Almost same as one hope query, except that <o:p></o:p></span></span></span></p>
<p class="MsoNoSpacing" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1;"><span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size: small;">&middot;</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;"><span style="font-size: small;">Cannot have complex expression on [Link Type] clause.<o:p></o:p></span></span></span></p>
<p class="MsoNoSpacing" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1;"><span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size: small;">&middot;</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;"><span style="font-size: small;">[Link Type] cannot be omitted, meaning it is <b style="mso-bidi-font-weight: normal;">not</b> <b style="mso-bidi-font-weight: normal;">optional</b>.<o:p></o:p></span></span></span></p>
<p class="MsoNoSpacing" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1;"><span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size: small;">&middot;</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Link type must be Tree topology and forward direction.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></span></b></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-size: small;"><span style="font-family: Calibri;"><b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">&ldquo;Order by&rdquo; </span></b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">and<b> &ldquo;As Of&rdquo;</b> are not compatible with tree queries.<b><o:p></o:p></b></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">&lt;mode&gt;<o:p></o:p></span></span></span></b></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Tree queries are representing with <b style="mso-bidi-font-weight: normal;">recursive mode</b>, returning results recursively for target.<o:p></o:p></span></span></span></p>
</p>]]></content:encoded>
    </item>
    <item>
      <title>Extending Work Item Tracking Context Menus</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/extending-work-item-tracking-context-menus</link>
      <pubDate>Thu, 24 Jun 2010 14:30:00 GMT</pubDate>
      <dc:creator><![CDATA[jontsao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/06/24/extending-work-item-tracking-context-menus/</guid>
      <description><![CDATA[&nbsp;
This blog post was written by Hayder Casey, a developer on the work item tracking team.
The...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p><em>This blog post was written by Hayder Casey, a developer on the work item tracking team.</em></p>
<p>The work item tracking context menus in Visual Studio are extensible. You can add your own commands to them and interact with the work item tracking editors and the hierarchy of queries and query folders in Team Explorer. </p>
<p>Visual Studio provides two mechanisms to achieve this: <a href="https://msdn.microsoft.com/en-us/vbasic/bb968855.aspx">Visual Studio Add-in</a> and <a href="https://msdn.microsoft.com/en-us/library/bb166424.aspx">Visual Studio Package</a>. If you are unfamiliar with Add-ins/Packages I recommend reading the linked articles and deciding which approach you want to use. Packages are the preferred approach if you want deep integration with Visual Studio and TeamFoundation.</p>
<p>In this post I will walk you through extending work item tracking context menus via an add-in or a package for Visual Studio 2010 (the process is essentially the same for older releases). Both sample projects are attached. Both examples will extend two context menus, the query editor and query node in Team Explorer, as shown in the screenshots:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/4578.clip_image0027_67C750E1.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/4578.clip_5F00_image0027_5F00_67C750E1.jpg"><img height="357" width="450" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/4064.clip_image0027_thumb_0CE49B4E.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/4064.clip_5F00_image0027_5F00_thumb_5F00_0CE49B4E.jpg" alt="clip_image002[7]" border="0" title="clip_image002[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p>Above: a row in the query editor with a &ldquo;Clear&rdquo; option in the context menu.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/1832.clip_image0047_1D106347.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/1832.clip_5F00_image0047_5F00_1D106347.jpg"><img height="498" width="453" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/8713.clip_image0047_thumb_4FFFF3AE.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/8713.clip_5F00_image0047_5F00_thumb_5F00_4FFFF3AE.jpg" alt="clip_image004[7]" border="0" title="clip_image004[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p>Above: the query node in Team Explorer with a &ldquo;Copy Query Expression to Clipboard&rdquo; option in the context menu.</p>
<p>Attached to the blog post is a zip containing the sample code for both examples.</p>
<h4>Visual Studio Add-in:</h4>
<p>Start by creating a Visual Studio Add-in: File&gt; New Project, and select &lsquo;Visual Studio Add-in&rsquo;.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/3480.clip_image0067_2145907B.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/3480.clip_5F00_image0067_5F00_2145907B.jpg"><img height="311" width="512" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/7607.clip_image0067_thumb_20D95D86.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/7607.clip_5F00_image0067_5F00_thumb_5F00_20D95D86.jpg" alt="clip_image006[7]" border="0" title="clip_image006[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p>Hit OK. This will bring up the add-in wizard. After you hit Finish and complete the wizard, a project is created for you. There is one class produced called Connect (connect.cs file). This is the main class (point of entry) for an add-in. The Connect class has an OnConnection method (one of the IDTExtensibility2 interface&rsquo;s members). This is called when the add-in is initialized.</p>
<p>We are interested in extending the command for the work item tracking context menu. First, we need to find the name of the menu we are interested in, add a command to it, then add a handler for executing/querying status to support this command. This process is the same for all Visual Studio menus.</p>
<p>Here are a couple of helper methods for adding commands to the context menu that you can add to the connect class.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #008000">/// &lt;summary&gt;</span><br /><span style="color: #008000">/// Adds a command to VS context menu</span><br /><span style="color: #008000">/// &lt;/summary&gt;</span><br /><span style="color: #008000">/// &lt;param name="menuName"&gt;The name of the menu&lt;/param&gt;</span><br /><span style="color: #008000">/// &lt;param name="commandName"&gt;Reference name of the command&lt;/param&gt;</span><br /><span style="color: #008000">/// &lt;param name="commandText"&gt;Display name of the command&lt;/param&gt;</span><br /><span style="color: #008000">/// &lt;param name="iconId"&gt;MSO icon id of the command&lt;/param&gt;</span><br /><span style="color: #008000">/// &lt;param name="position"&gt;position of command 1 = first item in the menu&lt;/param&gt;</span><br /><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> AddCommandToContextMenu(<span style="color: #0000ff">string</span> menuName, <span style="color: #0000ff">string</span> commandName, <span style="color: #0000ff">string</span> commandText, <span style="color: #0000ff">int</span> iconId, <span style="color: #0000ff">int</span> position)<br />{<br />    CommandBar contextMenu = ((CommandBars)_applicationObject.CommandBars)[menuName];<br />    AddCommand(contextMenu, commandName, commandText, iconId, position);<br />}<br /><br /><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> AddCommand(CommandBar parent, <span style="color: #0000ff">string</span> commandName, <span style="color: #0000ff">string</span> commandText, <span style="color: #0000ff">int</span> iconId, <span style="color: #0000ff">int</span> position)<br />{<br />    Commands2 commands = (Commands2)_applicationObject.Commands;<br />    <span style="color: #008000">//create the command</span><br />    Command newCommand = commands.AddNamedCommand2(_addInInstance, commandName, commandText, commandText, <span style="color: #0000ff">true</span>, iconId);<br />    <span style="color: #008000">// add it to parent menu</span><br />    newCommand.AddControl(parent, position);<br />}</pre>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>In OnConnection method, we just make a call to AddCommandToContextMenu to add this command:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> OnConnection(<span style="color: #0000ff">object</span> application, ext_ConnectMode connectMode, <span style="color: #0000ff">object</span> addInInst, <span style="color: #0000ff">ref</span> Array custom)<br />{<br />    _applicationObject = (DTE2)application;<br />    _addInInstance = (AddIn)addInInst;<br /><br />    <span style="color: #0000ff">if</span>(connectMode == ext_ConnectMode.ext_cm_UISetup)<br />    {<br />          AddCommandToContextMenu(<br />               WorkItemTrackingMenus.QueryBuilderContextMenu, <span style="color: #008000">// context menu Name</span><br />               <span style="color: #006080">"ClearQuery"</span>, <span style="color: #008000">// menu reference name</span><br />               <span style="color: #006080">"Clear"</span>, <span style="color: #008000">// display name</span><br />               47, <span style="color: #008000">// command icon</span><br />               1)    <span style="color: #008000">// command placement, 1= first item on top</span><br />    }<br />}</pre>
</div>
<p>The command icon ID is the ID for the MSO icon. There are about 8000 of those icons. This blog post has the first 3000 icons listed with their IDs: <a href="https://www.kebabshopblues.co.uk/2007/01/04/visual-studio-2005-tools-for-office-commandbarbutton-faceid-property/">https://www.kebabshopblues.co.uk/2007/01/04/visual-studio-2005-tools-for-office-commandbarbutton-faceid-property/</a>.</p>
<p>Here is a class that lists the menu names for Work Item Tracking (note: I have not tested this against a localized version of VS):</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">class</span> WorkItemTrackingMenus<br />{<br />    <span style="color: #008000">//context menus</span><br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> QueryBuilderContextMenu = <span style="color: #006080">"Query Builder"</span>;<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> ResultsListContextMenu = <span style="color: #006080">"Results List"</span>;<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> WorkItemEditorContextMenu = <span style="color: #006080">"Work Item"</span>;<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> ResultListColumnHeaderContextMenu = <span style="color: #006080">"Results List Column Sort"</span>;<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> WorkItemTENodeContextMenu = <span style="color: #006080">"Work Items"</span>;<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> QueryFolderTENodeContextMenu = <span style="color: #006080">"Query Folder"</span>;<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> QueryTENodeContextMenu = <span style="color: #006080">"Query"</span>;<br /><br />    <span style="color: #008000">//toolbar</span><br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> WorkItemTrackingToolbar = <span style="color: #006080">"Work Item Tracking"</span>;<br /><br />}</pre>
</div>
<p>&nbsp;</p>
<p>The connect class needs to implement IDTCommandTarget (<a href="https://msdn.microsoft.com/en-us/library/envdte.idtcommandtarget.aspx">https://msdn.microsoft.com/en-us/library/envdte.idtcommandtarget.aspx</a> ). It should already implement that interface when you created the project. Here is the interface definition for your reference:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">interface</span> IDTCommandTarget<br />{<br />    <span style="color: #0000ff">void</span> Exec(<span style="color: #0000ff">string</span> CmdName, vsCommandExecOption ExecuteOption, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">object</span> VariantIn, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">object</span> VariantOut, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">bool</span> Handled);<br />    <span style="color: #0000ff">void</span> QueryStatus(<span style="color: #0000ff">string</span> CmdName, vsCommandStatusTextWanted NeededText, <span style="color: #0000ff">ref</span> vsCommandStatus StatusOption, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">object</span> CommandText);<br />}</pre>
</div>
<p>Basically, the Exec method is used to execute commands added by the addin, and QueryStatus is used to determine the status of those commands dynamically. Status of a command can be enabled, disabled, hidden. You can do more with the status command, such as change the text of the command dynamically but I won&rsquo;t get into that here.</p>
<p>Here is the Exec implementation to handle this command:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> Exec(<span style="color: #0000ff">string</span> commandName, vsCommandExecOption executeOption, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">object</span> varIn, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">object</span> varOut, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">bool</span> handled)<br />{<br />    handled = <span style="color: #0000ff">false</span>;<br />    <span style="color: #0000ff">if</span> (executeOption != vsCommandExecOption.vsCommandExecOptionDoDefault)<br />    {<br />        <span style="color: #0000ff">return</span>;<br />    }<br /><br />    IWorkItemTrackingDocument document = GetActiveDocument();<br />    IQueryDocument queryDoc = document <span style="color: #0000ff">as</span> IQueryDocument;<br /><br />    <span style="color: #0000ff">switch</span> (commandName)<br />    {<br />        <span style="color: #0000ff">case</span> <span style="color: #006080">"MyAddin1.Connect.ClearQuery"</span>:<br />            <span style="color: #008000">//we only perform the action when the active document is a query</span><br />            <span style="color: #0000ff">if</span> (queryDoc != <span style="color: #0000ff">null</span>)<br />            {<br />                queryDoc.QueryText = <span style="color: #006080">""</span>;<br />            }<br />            handled = <span style="color: #0000ff">true</span>;<br />            <span style="color: #0000ff">break</span>;<br />    }<br />}</pre>
</div>
<p>The name is preceded by the full class name; in this case it&rsquo;s &ldquo;MyAddins1.Connect&rdquo;.</p>
<p>You will need to add some assembly references to the project so that you can use work item tracking extensibility:</p>
<ul>
<li>Microsoft.TeamFoundation.Client.dll </li>
<li>Microsoft.TeamFoundation.WorkItemTracking.Client.dll </li>
<li>Microsoft.TeamFoundation.WorkItemTracking.Controls.dll </li>
<li>Microsoft.VisualStudio.TeamFoundation.Client.dll </li>
<li>Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.dll </li>
<li>Microsoft.VisualStudio.OLE.Interop.dll </li>
<li>Microsoft.VisualStudio.TeamFoundation.dll </li>
</ul>
<p>GetActiveDocument() is a helper method I wrote that returns the active work item tracking document. There are three types of work item tracking documents: Workitem Editor, Results Editor, and Query Editor. Here is the implementation for GetActiveDocument:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> IWorkItemTrackingDocument GetActiveDocument()<br />    {<br /><br />        <span style="color: #0000ff">if</span> (_applicationObject.ActiveDocument != <span style="color: #0000ff">null</span>)<br />        {<br />            <span style="color: #0000ff">string</span> activeDocumentMoniker = _applicationObject.ActiveDocument.FullName;<br />            IWorkItemTrackingDocument doc = DocService.FindDocument(activeDocumentMoniker, _lockToken);<br />            <span style="color: #0000ff">if</span> (doc != <span style="color: #0000ff">null</span>)<br />            {<br />                doc.Release(_lockToken);<br />            }<br /><br />            <span style="color: #0000ff">return</span> doc;<br />        }<br /><br />        <span style="color: #0000ff">return</span> <span style="color: #0000ff">null</span>;<br /><br />    }<br /><br />    <span style="color: #0000ff">public</span> DocumentService DocService<br />    {<br />        get<br />        {<br />            <span style="color: #0000ff">if</span> (_documentService == <span style="color: #0000ff">null</span>)<br />            {<br />                _documentService = DTEObject.DTE.GetObject(<span style="color: #006080">"Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.DocumentService"</span>) <br />                    <span style="color: #0000ff">as</span> DocumentService;<br />            }<br />            <span style="color: #0000ff">return</span> _documentService;<br />        }<br />    }<br /><br />    <span style="color: #0000ff">private</span> <span style="color: #0000ff">object</span> _lockToken = <span style="color: #0000ff">new</span> <span style="color: #0000ff">object</span>(); <span style="color: #008000">// token used for locking the document</span><br />    <span style="color: #0000ff">private</span> DocumentService _documentService;</pre>
</div>
<p>
<a href="https://11011.net/software/vspaste"></a></p>
<p>When retrieving a Document from the DocumentService, you will need to pass a lock. DocumentService will lock it. That document will stay in cache until all locks are released. If your add-in needs to work with the document after it returned execution to Visual Studio, you should not release the document until you are done with it. Otherwise Visual Studio might dispose the document (say when the user closes the editor). </p>
<p>There might be multiple context menus with the same name, so when using the name only to retrieve the menu you will get the first one. I believe &ldquo;Results List&rdquo; is the only one in work item tracking that shares the same name with another context menu. To pick the right ResultsList I added a get helper method to retrieve a unique ContextMenu, by providing a unique command on the menu.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> AddCommandToUniqueContextMenu(<span style="color: #0000ff">string</span> menuName, <span style="color: #0000ff">string</span> uniqueCommandOnMenu, <span style="color: #0000ff">string</span> commandName, <span style="color: #0000ff">string</span> commandText, <span style="color: #0000ff">int</span> iconId, <span style="color: #0000ff">int</span> position)<br />    {<br />        CommandBar contextMenu = GetCommandBar(menuName, uniqueCommandOnMenu);<br />        AddCommand(contextMenu, commandName, commandText, iconId, position);<br />    }<br /><br />    <span style="color: #0000ff">private</span> CommandBar GetCommandBar(<span style="color: #0000ff">string</span> menuName, <span style="color: #0000ff">string</span> commandOnMenu)<br />    {<br />        List&lt;CommandBar&gt; bars = <span style="color: #0000ff">new</span> List&lt;CommandBar&gt;();<br />        <span style="color: #0000ff">foreach</span> (CommandBar menu <span style="color: #0000ff">in</span> ((CommandBars)_applicationObject.CommandBars))<br />        {<br />            <span style="color: #0000ff">if</span> (menu.Name == menuName)<br />            {<br />                <span style="color: #0000ff">try</span><br />                {<br />                     <span style="color: #0000ff">if</span> (menu.Controls[commandOnMenu] != <span style="color: #0000ff">null</span>)<br />                        <span style="color: #0000ff">return</span> menu;<br />                }<br />                <span style="color: #0000ff">catch</span><br />                {<br />                    <span style="color: #008000">// this is not the corrent menu, even thou the name matches</span><br />                }<br />            }                   <br />        }<br />        <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> Exception(<span style="color: #006080">"Failed to get command bar: "</span> + menuName);<br />    }</pre>
</div>
<p>
<a href="https://11011.net/software/vspaste"></a></p>
<p>This has one extra parameter, &lsquo;uniqueCommandOnMenu&rsquo;, that you can pass a name of a command that you know on this menu. This will basically keep looking for that menu until it finds one that matches the name AND contains the unique item.</p>
<p>Here is how you use this method from the Connect functions:</p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; font-size: 9.5pt"></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none">&nbsp;</p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none">&nbsp;</p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none">&nbsp;</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> UniqueItemOnResultsList = <span style="color: #006080">"Print Selection As List..."</span>;<br /><br />AddCommandToUniqueContextMenu(WorkItemTrackingMenus.ResultsListContextMenu,<br />      UniqueItemOnResultsList,<span style="color: #006080">"MyCommandRefName"</span>, <span style="color: #006080">"My Command"</span>, 283, 1);</pre>
</div>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><strong>Adding context menus to nodes in the Team Explorer</strong></p>
<p>The process is the same, but we will need to find the node under the context menu so we can execute context sensitive operations on it. </p>
<p>To add a &ldquo;Copy Query Expression To Clipboard&rdquo; command to the context menu of a query node in the Team Explorer:</p>
<p>First, add the command to the context menu. In OnConnection method we need to make this call:</p>
<p><span style="line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">AddCommandToContextMenu(<span style="color: #2b91af">WorkItemTrackingMenus</span>.<span style="background: yellow; mso-highlight: yellow">QueryTENodeContextMenu</span>, <span style="color: #a31515">"<span style="background: yellow; mso-highlight: yellow">CopyQueryWiql</span>"</span>, <span style="color: #a31515">"Copy Query Expression To Clipboard"</span>, 19, 1);</span> </p>
<p>And we just need to handle it in the Exec/Status call:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> Exec(<span style="color: #0000ff">string</span> commandName, vsCommandExecOption executeOption, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">object</span> varIn, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">object</span> varOut, <span style="color: #0000ff">ref</span> <span style="color: #0000ff">bool</span> handled)<br />{<br />    handled = <span style="color: #0000ff">false</span>;<br />    <span style="color: #0000ff">if</span> (executeOption != vsCommandExecOption.vsCommandExecOptionDoDefault)<br />    {<br />        <span style="color: #0000ff">return</span>;<br />    }<br /><br />    IWorkItemTrackingDocument document = GetActiveDocument();<br />    IQueryDocument queryDoc = document <span style="color: #0000ff">as</span> IQueryDocument;<br /><br />    <span style="color: #0000ff">switch</span> (commandName)<br />    {<br />        <span style="color: #0000ff">case</span> <span style="color: #006080">"MyAddin1.Connect.CopyQueryWiql"</span>:<br />            <br />            <span style="color: #0000ff">string</span>[] tokens = GetCurrentSelectedNodeInTE();<br /><br />            <span style="color: #008000">// now let&rsquo;s get server/project in TE </span><br />            TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(<span style="color: #0000ff">new</span> Uri(TeamExplorer.GetProjectContext().DomainUri));<br />            WorkItemStore store = tpc.GetService&lt;WorkItemStore&gt;();<br />            Microsoft.TeamFoundation.WorkItemTracking.Client.Project proj = store.Projects[tokens[1]];<br /><br />            <span style="color: #008000">//walk the hierarchy till we find the query definition of the selected item</span><br />            QueryItem qItem = proj.QueryHierarchy;<br /><br />            <span style="color: #008000">// start from second token, token[0] = server name, token[1]= project name</span><br />            <span style="color: #0000ff">int</span> currentTokenIndex = 2;<br />            <span style="color: #0000ff">while</span> (currentTokenIndex &lt; tokens.Length)<br />            {<br />                qItem = (qItem <span style="color: #0000ff">as</span> QueryFolder)[tokens[currentTokenIndex]];<br />                currentTokenIndex++;<br />            }<br /><br />            <span style="color: #008000">// we have the query defintion, just copy the expression to the clipboard.</span><br />            QueryDefinition def = qItem <span style="color: #0000ff">as</span> QueryDefinition;<br />            Clipboard.SetText(def.QueryText);<br /><br />            handled = <span style="color: #0000ff">true</span>;<br />            <span style="color: #0000ff">break</span>;<br />    }<br />}</pre>
</div>
<p>Here is the helper method to get TeamExplorer, and the currently selected node in the Team Explorer:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> IVsTeamExplorer TeamExplorer<br />{<br />    get<br />    {<br />        <span style="color: #008000">// get Team Explorer service from VS Add-in</span><br />        OleInterop.IServiceProvider serviceProvider = (OleInterop.IServiceProvider)_applicationObject;<br />        Guid guid = <span style="color: #0000ff">new</span> Guid(<span style="color: #0000ff">typeof</span>(IVsTeamExplorer).GUID.ToString());<br />        IntPtr ptr;<br />        <span style="color: #0000ff">int</span> result = serviceProvider.QueryService(<span style="color: #0000ff">ref</span> guid, <span style="color: #0000ff">ref</span> guid, <span style="color: #0000ff">out</span> ptr);<br />        <span style="color: #0000ff">if</span> (result != 0)<br />            <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> ApplicationException(<span style="color: #006080">"Failed to get Team Explorer service"</span>);<br />        IVsTeamExplorer TE = (IVsTeamExplorer)Marshal.GetObjectForIUnknown(ptr);<br /><br />        <span style="color: #0000ff">return</span> TE;<br />    }<br /><br />}<br /><br /><span style="color: #008000">/// &lt;summary&gt;</span><br /><span style="color: #008000">/// return an array of path token for the current selected node in TE</span><br /><span style="color: #008000">/// in the form of: {servername, project name, [intermediate nodes,]*, leaf node}</span><br /><span style="color: #008000">/// &lt;/summary&gt;</span><br /><span style="color: #0000ff">private</span> <span style="color: #0000ff">string</span>[] GetCurrentSelectedNodeInTE()<br />{<br />    <span style="color: #008000">// Get the TE hierarchy and the selected itemid</span><br />    IntPtr hier;<br />    <span style="color: #0000ff">uint</span> itemid;<br />    IVsMultiItemSelect dummy;<br />    TeamExplorer.TeamExplorerWindow.GetCurrentSelection(<span style="color: #0000ff">out</span> hier, <span style="color: #0000ff">out</span> itemid, <span style="color: #0000ff">out</span> dummy);<br /><br />    IVsHierarchy hierarchy = (IVsHierarchy)Marshal.GetObjectForIUnknown(hier);<br />    Marshal.Release(hier);<br /><br />    <span style="color: #008000">// now that we have the id and hierarchy, we can retrieve lots of properties about the node</span><br />    <span style="color: #008000">// in this case, we get the canonical name which is the in the form of (server/project/[query folders]*/query)</span><br /><br />    <span style="color: #0000ff">string</span> canonicalName;<br />    hierarchy.GetCanonicalName(itemid, <span style="color: #0000ff">out</span> canonicalName);<br /><br />    <span style="color: #0000ff">string</span>[] tokens = canonicalName.Split(<span style="color: #006080">'/'</span>);<br /><br />    <span style="color: #0000ff">return</span> tokens;<br />}</pre>
</div>
<h3>Visual Studio Package:</h3>
<p>You will notice a lot of similarities between the package and add-in approach. First we need to create a Visual Studio Package project. You will need to install the <a href="https://msdn.microsoft.com/en-us/library/bb166441.aspx">Visual Studio SDK</a> to see this type of project in the New Project Dialog.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/3276.clip_image0087_1378EF25.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/3276.clip_5F00_image0087_5F00_1378EF25.jpg"><img height="261" width="461" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/0243.clip_image0087_thumb_52A6F2F5.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/0243.clip_5F00_image0087_5F00_thumb_5F00_52A6F2F5.jpg" alt="clip_image008[7]" border="0" title="clip_image008[7]" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /></a></p>
<p>This will create a base project for you package. Several files are added, including WitContextMenuPackage.cs (or &lt;YourPPackageName&gt;Package.cs). This is the main class entry point for a VS package. You will notice that it derives from Microsoft.VisualStudio.Shell.Package (<a href="https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.package.aspx">https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.package.aspx</a>) </p>
<p>You will need to add some team foundation assembly references that are needed for extensibility:</p>
<p>Microsoft.TeamFoundation.Client.dll 
  <br />Microsoft.TeamFoundation.WorkItemTracking.Client.dll 
  <br />Microsoft.TeamFoundation.WorkItemTracking.Controls.dll 
  <br />Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.dll 
  <br />Microsoft.VisualStudio.TeamFoundation.dll 
  <br />Microsoft.VisualStudio.TeamFoundation.Client.dll 
  <br />
  <br />Now add the command to some menus. The command/menus are specified in the *.vsct file (<a href="https://msdn.microsoft.com/en-us/library/bb166366.aspx">https://msdn.microsoft.com/en-us/library/bb166366.aspx</a>) . You will need to add a Guids.h file that specifies the work item tracking ids. We will need those IDs to place our command under work item tracking context menus. (note that these IDs might change in future releases of Visual Studio):</p>
<p>Content of Guids.h:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #cc6633">#define</span> WorkItemTrackingGuid    { 0x2DC8D6BB, 0x916C, 0x4B80, { 0x9C, 0x52, 0xFD, 0x8F, 0xC3, 0x71, 0xAC, 0xC2 } }<br /><br /><span style="color: #008000">// work item tracking toolbar</span><br /><span style="color: #cc6633">#define</span> TBWorkItemTracking    0x100<br /><br /><span style="color: #008000">// TeamExplorer WorkItems node Context Menu</span><br /><span style="color: #cc6633">#define</span> TEWorkItems            0x201<br /><br /><span style="color: #008000">// TeamExplorer Query Folder node Context Menu</span><br /><span style="color: #cc6633">#define</span> TEQueryGroup        0x202<br /><br /><span style="color: #008000">// TeamExplorer Query node Context Menu</span><br /><span style="color: #cc6633">#define</span> TEQuery                0x203<br /><br /><span style="color: #008000">//Query Builder Context Menu</span><br /><span style="color: #cc6633">#define</span> QueryBuilder        0x204<br /><br /><span style="color: #008000">//Result List Context Menu</span><br /><span style="color: #cc6633">#define</span> ResultList            0x205<br /><br /><span style="color: #008000">// Work Item Editor Context Menu</span><br /><span style="color: #cc6633">#define</span> WorkItem            0x206<br /><br /><span style="color: #008000">// Sort Result Header Context Menu</span><br /><span style="color: #cc6633">#define</span> ResultListSort        0x209<br /><br /><span style="color: #008000">//Team Foundation Main Menu, use guidSHLMainMenu guid with this ID</span><br /><span style="color: #008000">//#define IDM_MENU_TEAM_FOUNDATION_CLIENT     0x700</span></pre>
</div>
<p>Every menu, group or command in VS is reference by a context Guid/id pair. Work item tracking context menus all use WorkItemTrackingGuid, and each menu has a unique id as specified in the guids.h above.</p>
<p>We will be adding the same commands as the add-in example above: &lsquo;Clear Query&rsquo; and &lsquo;Copy Query Expression&rsquo;. Here is what the vsct file looks like:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">&lt;?xml version=<span style="color: #006080">"1.0"</span> encoding=<span style="color: #006080">"utf-8"</span>?&gt;<br />&lt;CommandTable xmlns=<span style="color: #006080">"https://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable"</span> xmlns:xs=<span style="color: #006080">"https://www.w3.org/2001/XMLSchema"</span>&gt;<br />  &lt;Extern href=<span style="color: #006080">"stdidcmd.h"</span>/&gt;<br />  &lt;Extern href=<span style="color: #006080">"vsshlids.h"</span>/&gt;<br />  &lt;Extern href=<span style="color: #006080">"msobtnid.h"</span>/&gt;<br />  &lt;Extern href=<span style="color: #006080">"guids.h"</span>/&gt;<br /><br />  &lt;Commands package=<span style="color: #006080">"WitContextMenuPkg"</span>&gt;<br />    &lt;Groups&gt;<br />      &lt;Group guid=<span style="color: #006080">"guidWitContextMenuCmdSet"</span> id=<span style="color: #006080">"GueryBuilderGroup"</span> priority=<span style="color: #006080">"0x001"</span>&gt;<br />        &lt;Parent guid=<span style="color: #006080">"WorkItemTrackingGuid"</span> id=<span style="color: #006080">"QueryBuilder"</span>/&gt;<br />      &lt;/Group&gt;<br />      &lt;Group guid=<span style="color: #006080">"guidWitContextMenuCmdSet"</span> id=<span style="color: #006080">"GueryNodeGroup"</span> priority=<span style="color: #006080">"0x200"</span>&gt;<br />        &lt;Parent guid=<span style="color: #006080">"WorkItemTrackingGuid"</span> id=<span style="color: #006080">"TEQuery"</span>/&gt;<br />      &lt;/Group&gt;      <br />    &lt;/Groups&gt;<br />    <br />    &lt;Buttons&gt;<br /><br />      &lt;!-- Adding a clear command to query builder context menu--&gt;<br />      &lt;Button guid=<span style="color: #006080">"guidWitContextMenuCmdSet"</span> id=<span style="color: #006080">"cmdidClearQuery"</span> priority=<span style="color: #006080">"0x0100"</span> type=<span style="color: #006080">"Button"</span>&gt;<br />        &lt;Parent guid=<span style="color: #006080">"guidWitContextMenuCmdSet"</span> id=<span style="color: #006080">"GueryBuilderGroup"</span> /&gt;<br />        &lt;Icon guid=<span style="color: #006080">"guidImages"</span> id=<span style="color: #006080">"bmpPicX"</span> /&gt;<br />        &lt;CommandFlag&gt;DynamicVisibility&lt;/CommandFlag&gt;<br />        &lt;CommandFlag&gt;DefaultInvisible&lt;/CommandFlag&gt;<br />        &lt;CommandFlag&gt;DefaultDisabled&lt;/CommandFlag&gt;        <br />        &lt;Strings&gt;<br />          &lt;CommandName&gt;cmdidClearQuery&lt;/CommandName&gt;<br />          &lt;ButtonText&gt;Clear&lt;/ButtonText&gt;<br />        &lt;/Strings&gt;<br />      &lt;/Button&gt;<br /><br />      &lt;!-- Adding copy query expression item to query node context menu--&gt;<br />      &lt;Button guid=<span style="color: #006080">"guidWitContextMenuCmdSet"</span> id=<span style="color: #006080">"cmdidCopyQueryExpression"</span> priority=<span style="color: #006080">"0x0100"</span> type=<span style="color: #006080">"Button"</span>&gt;<br />        &lt;Parent guid=<span style="color: #006080">"guidWitContextMenuCmdSet"</span> id=<span style="color: #006080">"GueryNodeGroup"</span> /&gt;<br />        &lt;Icon guid=<span style="color: #006080">"guidImages"</span> id=<span style="color: #006080">"bmpPicArrows"</span> /&gt;<br />        &lt;CommandFlag&gt;DynamicVisibility&lt;/CommandFlag&gt;<br />        &lt;CommandFlag&gt;DefaultInvisible&lt;/CommandFlag&gt;<br />        &lt;CommandFlag&gt;DefaultDisabled&lt;/CommandFlag&gt;<br />        &lt;Strings&gt;<br />          &lt;CommandName&gt;cmdidCopyQueryExpression&lt;/CommandName&gt;<br />          &lt;ButtonText&gt;Copy Query Expression&lt;/ButtonText&gt;<br />        &lt;/Strings&gt;<br />      &lt;/Button&gt;<br /><br />    &lt;/Buttons&gt;<br />    &lt;Bitmaps&gt;<br />      &lt;Bitmap guid=<span style="color: #006080">"guidImages"</span> href=<span style="color: #006080">"Resources\Images_32bit.bmp"</span> usedList=<span style="color: #006080">"bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows"</span>/&gt;<br />    &lt;/Bitmaps&gt;<br />  &lt;/Commands&gt;<br />  &lt;Symbols&gt;<br />    &lt;!-- This <span style="color: #0000ff">is</span> the package guid. --&gt;<br />    &lt;GuidSymbol name=<span style="color: #006080">"guidWitContextMenuPkg"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"{caecbd03-bbe1-4118-815e-371e826ed06c}"</span> /&gt;<br />    <br />    &lt;!-- This <span style="color: #0000ff">is</span> the guid used to group the menu commands together --&gt;<br />    &lt;GuidSymbol name=<span style="color: #006080">"guidWitContextMenuCmdSet"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"{b7351957-4311-442a-b637-e3bbe3d0ddfd}"</span>&gt;<br /><br />      &lt;IDSymbol name=<span style="color: #006080">"GueryBuilderGroup"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"0x1030"</span> /&gt;<br />      &lt;IDSymbol name=<span style="color: #006080">"GueryNodeGroup"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"0x1040"</span> /&gt; <br /><br />      &lt;IDSymbol name=<span style="color: #006080">"cmdidClearQuery"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"0x0200"</span> /&gt;<br />      &lt;IDSymbol name=<span style="color: #006080">"cmdidCopyQueryExpression"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"0x0300"</span> /&gt;<br />      <br />    &lt;/GuidSymbol&gt;<br />    <br />    &lt;GuidSymbol name=<span style="color: #006080">"guidImages"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"{851f7727-1e2b-4642-b481-066abe7957ed}"</span> &gt;<br />      &lt;IDSymbol name=<span style="color: #006080">"bmpPic1"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"1"</span> /&gt;<br />      &lt;IDSymbol name=<span style="color: #006080">"bmpPic2"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"2"</span> /&gt;<br />      &lt;IDSymbol name=<span style="color: #006080">"bmpPicSearch"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"3"</span> /&gt;<br />      &lt;IDSymbol name=<span style="color: #006080">"bmpPicX"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"4"</span> /&gt;<br />      &lt;IDSymbol name=<span style="color: #006080">"bmpPicArrows"</span> <span style="color: #0000ff">value</span>=<span style="color: #006080">"5"</span> /&gt;<br />    &lt;/GuidSymbol&gt;<br />  &lt;/Symbols&gt;<br /><br />&lt;/CommandTable&gt;</pre>
</div>
<p>The above will add the two commands to the context menus. Now we will need to modify our package code so that it can handle the execution of these commands.</p>
<p>Modify PkgCmdId.cs to include the new command IDs we are adding:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">static</span> <span style="color: #0000ff">class</span> PkgCmdIDList<br />    {<br />        <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">uint</span> cmdidClearQuery = 0x200;<br />        <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">uint</span> cmdidCopyQueryExpression = 0x300;<br />    };</pre>
</div>
<p>First to make sure our package is handling the command we need to specify that it needs to be auto loaded when we are connected to a team foundation server. We just need to add an attribute to our package as follows:</p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: green; font-size: 9.5pt">// initialize this package if team explorer is connected to a server
    <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="background: yellow; mso-highlight: yellow">[<span style="color: #2b91af">ProvideAutoLoad</span>(<span style="color: #a31515">"{e13eedef-b531-4afe-9725-28a69fa4f896}"</span>)]</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="color: blue">public</span> <span style="color: blue">sealed</span> <span style="color: blue">class</span> <span style="color: #2b91af">WITContextMenuPackage</span> : <span style="color: #2b91af">Package</span>, <span style="color: #2b91af">IOleCommandTarget
      <br /></span></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>{
    </span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The highlighted line above is the context guid of Team Explorer connected to a server.</p>
<p>We also need to make our package derive from IOleCommandTarget so it can handle the command. Also, there might be some menu code in the Initialize(). Clear all code in that function. You can do some initialization here, but for the purposes of this example, this function should be empty:</p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: blue; font-size: 9.5pt">protected</span><span style="font-family: consolas; font-size: 9.5pt"> <span style="color: blue">override</span> <span style="color: blue">void</span> Initialize()
    <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>{
    <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">base</span>.Initialize();
    <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>}
    </span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Package class has a GetService Method. We can use that to get various VS services, such as Team Explorer and DTE. The code is similar to the add-in example. Here are the helper methods to get the active document and SelectedNode in TE:</p>
<p>Partial listing of WITContextMenuPackage class:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> EnvDTE.DTE DTE<br />{<br />    get<br />    {<br />        <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.GetService(<span style="color: #0000ff">typeof</span>(EnvDTE.DTE)) <span style="color: #0000ff">as</span> EnvDTE.DTE;<br />    }<br />}<br /><br /><span style="color: #0000ff">public</span> IVsTeamExplorer TeamExplorer<br />{<br />    get<br />    {<br />        <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.GetService(<span style="color: #0000ff">typeof</span>(IVsTeamExplorer)) <span style="color: #0000ff">as</span> IVsTeamExplorer;<br />    }<br />}<br /><br /><span style="color: #0000ff">public</span> DocumentService DocService<br />{<br />    get<br />    {<br />        <span style="color: #0000ff">return</span> DTE.GetObject(<span style="color: #006080">"Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.DocumentService"</span>)<br />                <span style="color: #0000ff">as</span> DocumentService;<br />    }<br />}<br /><br /><span style="color: #0000ff">public</span> IWorkItemTrackingDocument GetActiveDocument()<br />{<br />    <span style="color: #0000ff">if</span> (DTE.ActiveDocument != <span style="color: #0000ff">null</span>)<br />    {<br />        <span style="color: #0000ff">string</span> activeDocumentMoniker = DTE.ActiveDocument.FullName;<br />        IWorkItemTrackingDocument doc = DocService.FindDocument(activeDocumentMoniker, _lockToken);<br />        <span style="color: #0000ff">if</span> (doc != <span style="color: #0000ff">null</span>)<br />        {<br />            doc.Release(_lockToken);<br />        }<br /><br />        <span style="color: #0000ff">return</span> doc;<br />    }<br /><br />    <span style="color: #0000ff">return</span> <span style="color: #0000ff">null</span>;<br />}<br /><br /><span style="color: #0000ff">private</span> <span style="color: #0000ff">string</span>[] GetCurrentSelectedNodeInTE()<br />{<br />    <span style="color: #008000">// Get the TE hierarchy and the selected itemid</span><br />    IntPtr hier;<br />    <span style="color: #0000ff">uint</span> itemid;<br />    IVsMultiItemSelect dummy;<br />    TeamExplorer.TeamExplorerWindow.GetCurrentSelection(<span style="color: #0000ff">out</span> hier, <span style="color: #0000ff">out</span> itemid, <span style="color: #0000ff">out</span> dummy);<br /><br />    IVsHierarchy hierarchy = (IVsHierarchy)Marshal.GetObjectForIUnknown(hier);<br />    Marshal.Release(hier);<br /><br />    <span style="color: #008000">// now that we have the id and hierarchy, we can retrieve lots of properties about the node</span><br />    <span style="color: #008000">// in this case, we get the canonical name which is the in the form of (server/project/[query folders]*/query)</span><br />    <span style="color: #0000ff">string</span> canonicalName;<br />    hierarchy.GetCanonicalName(itemid, <span style="color: #0000ff">out</span> canonicalName);<br /><br />    <span style="color: #0000ff">string</span>[] tokens = canonicalName.Split(<span style="color: #006080">'/'</span>);<br /><br />    <span style="color: #0000ff">return</span> tokens;<br />}</pre>
</div>
<p>Here is the implementation of IOleCommandTarget:</p>
<p>Partial listing of WITContextMenuPackage class:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">int</span> IOleCommandTarget.Exec(<span style="color: #0000ff">ref</span> Guid pguidCmdGroup, <span style="color: #0000ff">uint</span> nCmdID, <span style="color: #0000ff">uint</span> nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)<br />{<br />    <span style="color: #0000ff">if</span> (pguidCmdGroup != GuidList.guidWITExtensibilityPkgCmdSet)<br />    {<br />        <span style="color: #0000ff">return</span> OLECMDERR_E_UNKNOWNGROUP;<br />    }<br /><br />    IWorkItemTrackingDocument document = GetActiveDocument();<br />    IQueryDocument queryDoc = document <span style="color: #0000ff">as</span> IQueryDocument;<br /><br />    <span style="color: #0000ff">switch</span> (nCmdID)<br />    {<br />        <span style="color: #0000ff">case</span> PkgCmdIDList.cmdidClearQuery:<br />            <span style="color: #0000ff">if</span> (queryDoc != <span style="color: #0000ff">null</span>)<br />            {<br />                queryDoc.QueryText = <span style="color: #006080">""</span>;<br />            }<br />            <span style="color: #0000ff">break</span>;<br /><br />        <span style="color: #0000ff">case</span> PkgCmdIDList.cmdidCopyQueryExpression:<br /><br />            <span style="color: #0000ff">string</span>[] pathTokens = GetCurrentSelectedNodeInTE();<br /><br />            <span style="color: #008000">// now let&rsquo;s get server/project and walk the hierarchy till we find the query definition of the selected item</span><br /><br />            TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(<span style="color: #0000ff">new</span> Uri(TeamExplorer.GetProjectContext().DomainUri));<br /><br />            WorkItemStore store = tpc.GetService&lt;WorkItemStore&gt;();<br />            Microsoft.TeamFoundation.WorkItemTracking.Client.Project proj = store.Projects[pathTokens[1]];<br />            QueryItem qItem = proj.QueryHierarchy;<br />            <span style="color: #0000ff">int</span> currentTokenIndex = 2;<br />            <span style="color: #0000ff">while</span> (currentTokenIndex &lt; pathTokens.Length)<br />            {<br />                qItem = (qItem <span style="color: #0000ff">as</span> QueryFolder)[pathTokens[currentTokenIndex]];<br />                currentTokenIndex++;<br />            }<br /><br />            <span style="color: #008000">// we have the query definition, just copy the expression to the clipboard.</span><br />            QueryDefinition def = qItem <span style="color: #0000ff">as</span> QueryDefinition;<br />            Clipboard.SetText(def.QueryText);<br /><br />            <span style="color: #0000ff">break</span>;<br /><br />        <span style="color: #0000ff">default</span>:<br />            <span style="color: #0000ff">return</span> OLECMDERR_E_UNKNOWNGROUP;<br />    }<br /><br />    <span style="color: #0000ff">return</span> VSConstants.S_OK;<br />}<br /><br /><span style="color: #0000ff">int</span> IOleCommandTarget.QueryStatus(<span style="color: #0000ff">ref</span> Guid pguidCmdGroup, <span style="color: #0000ff">uint</span> cCmds, OLECMD[] prgCmds, IntPtr pCmdText)<br />{<br />    <span style="color: #0000ff">if</span> (pguidCmdGroup != GuidList.guidWITExtensibilityPkgCmdSet)<br />    {<br />        <span style="color: #0000ff">return</span> OLECMDERR_E_UNKNOWNGROUP;<br />    }<br /><br />    IWorkItemTrackingDocument document = GetActiveDocument();<br />    IQueryDocument queryDoc = document <span style="color: #0000ff">as</span> IQueryDocument;<br /><br />    <span style="color: #0000ff">switch</span> (prgCmds[0].cmdID)<br />    {<br />        <span style="color: #0000ff">case</span> PkgCmdIDList.cmdidClearQuery:<br />            <span style="color: #008000">// this command is in the context menu of query builder, so its always enabled.</span><br /><br />            <span style="color: #008000">// but if want it to be added to a main menu, or assign a shortcut to it, it should</span><br />            <span style="color: #008000">// only be enabled if the active document is a query editor, </span><br />            <span style="color: #008000">// the following code disable this command if we are not in a query editor</span><br /><br />            <span style="color: #0000ff">if</span> (queryDoc != <span style="color: #0000ff">null</span>)<br />            {<br />                <span style="color: #008000">// in a query document context, Enabled</span><br />                prgCmds[0].cmdf = (<span style="color: #0000ff">int</span>)OLECMDF.OLECMDF_SUPPORTED | (<span style="color: #0000ff">int</span>)OLECMDF.OLECMDF_ENABLED;<br />            }<br />            <span style="color: #0000ff">else</span><br />            {<br />                <span style="color: #008000">// not in a query document, Disable</span><br />                prgCmds[0].cmdf = (<span style="color: #0000ff">int</span>)OLECMDF.OLECMDF_SUPPORTED;<br />            }<br />            <span style="color: #0000ff">break</span>;<br /><br />        <span style="color: #0000ff">case</span> PkgCmdIDList.cmdidCopyQueryExpression:<br />            <span style="color: #008000">// we will always enable it since its always on the context menu of a query</span><br />            prgCmds[0].cmdf = (<span style="color: #0000ff">int</span>)OLECMDF.OLECMDF_SUPPORTED | (<span style="color: #0000ff">int</span>)OLECMDF.OLECMDF_ENABLED;<br />            <span style="color: #0000ff">break</span>;<br /><br />        <span style="color: #0000ff">default</span>:<br />            <span style="color: #0000ff">return</span> OLECMDERR_E_UNKNOWNGROUP;<br /><br />    }<br />    <span style="color: #0000ff">return</span> VSConstants.S_OK;<br />}</pre>
</div>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/02/98/47/WITContextMenus.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-02-98-47/WITContextMenus.zip">WITContextMenus.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Work Item Tracking Queries Object Model in 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/work-item-tracking-queries-object-model-in-2010</link>
      <pubDate>Wed, 16 Jun 2010 12:58:00 GMT</pubDate>
      <dc:creator><![CDATA[jontsao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/06/16/work-item-tracking-queries-object-model-in-2010/</guid>
      <description><![CDATA[The following post was written by Smitha Saligrama, a software development engineer in test on the...]]></description>
      <content:encoded><![CDATA[<p><em>The following post was written by Smitha Saligrama, a software development engineer in test on the work item tracking team for Team Foundation Server</em>.</p>
<p>To allow better organization and permissions on queries in Team Foundation Server 2010 we added query folders. Query folders allow you to organize both your personal queries and project queries into nested folders:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5706.image_1E28C408.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5706.image_5F00_1E28C408.png"><img height="353" width="261" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/7268.image_thumb_2B5F274E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/7268.image_5F00_thumb_5F00_2B5F274E.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a> </p>
<p>Because of this change, there are some changes to the work item tracking queries object model.</p>
<h2>Object Model</h2>
<p>StoredQuery and StoredQueryCollection are now obsolete and are replaced by new types, QueryDefinition and QueryFolder, both deriving from the same base class (QueryItem). A QueryFolder contains a collection of QueryItem objects, each of which may be a QueryFolder or a QueryDefinition.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/5621.image_5CEA94E3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/5621.image_5F00_5CEA94E3.png"><img height="477" width="827" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/8741.image_thumb_6A50A7E9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/8741.image_5F00_thumb_5F00_6A50A7E9.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a> </p>
<h2>Samples</h2>
<h2><strong><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi">Adding a new query folder </span></strong></h2>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: #2b91af; font-size: 9.5pt">QueryFolder</span><span style="font-family: consolas; font-size: 9.5pt"> folder = <span style="color: blue">new</span> <span style="color: #2b91af">QueryFolder</span>(<span style="color: #a31515">"My New Folder"</span>); <br /></span><span style="font-family: consolas; color: #2b91af; font-size: 9.5pt">QueryFolder</span><span style="font-family: consolas; font-size: 9.5pt"> parentFolder = GetMyQueriesFolder(); <br /></span><span style="font-family: consolas; font-size: 9.5pt">parentFolder.Add(folder); <br /></span><span style="font-family: consolas; font-size: 9.5pt">myproject.QueryHierarchy.Save();</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: green; font-size: 9.5pt">//OR</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: #2b91af; font-size: 9.5pt">QueryFolder</span><span style="font-family: consolas; font-size: 9.5pt"> folder = <span style="color: blue">new</span> <span style="color: #2b91af">QueryFolder</span>(<span style="color: #a31515">"My New Folder"</span>, GetMyQueriesFolder()); <br /></span><span style="font-family: consolas; font-size: 9.5pt">myproject.QueryHierarchy.Save();</span><strong><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi">&nbsp;</span></strong></p>
<h3>Adding a new query</h3>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: #2b91af; font-size: 9.5pt">QueryDefinition</span><span style="font-family: consolas; font-size: 9.5pt"> query = <span style="color: blue">new</span> <span style="color: #2b91af">QueryDefinition</span>(<span style="color: #a31515">"My Query"</span>, <span style="color: #a31515">"Select * from WorkItems Where [System.AssignedTo] = @me"</span>, parentFolder); <br /></span><span style="font-family: consolas; font-size: 9.5pt">myproject.QueryHierarchy.Save();</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: green; font-size: 9.5pt">//OR</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: #2b91af; font-size: 9.5pt">QueryDefinition</span><span style="font-family: consolas; font-size: 9.5pt"> query = <span style="color: blue">new</span> <span style="color: #2b91af">QueryDefinition</span>(<span style="color: #a31515">"My Query"</span>, <span style="color: #a31515">"Select * from WorkItems Where [System.AssignedTo] = @me"</span>); <br /></span><span style="font-family: consolas; font-size: 9.5pt">parentFolder.Add(query); <br /></span><span style="font-family: consolas; font-size: 9.5pt">myproject.QueryHierarchy.Save();&nbsp;</span></p>
<h3>Renaming a query or folder</h3>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: green; font-size: 9.5pt">//QueryItem folderOrQuery <br /></span><span style="font-family: consolas; font-size: 9.5pt">folderOrQuery.Name = <span style="color: #a31515">"My Renamed folder"</span>; <br /></span><span style="font-family: consolas; font-size: 9.5pt">myproject.QueryHierarchy.Save();&nbsp;</span></p>
<h3>Moving a query or folder</h3>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: green; font-size: 9.5pt">//QueryItem queryItem <br /></span><span style="font-family: consolas; color: green; font-size: 9.5pt">//QueryFolder targetFolder <br /></span><span style="font-family: consolas; font-size: 9.5pt">targetFolder.Add(queryItem); <br /></span><span style="font-family: consolas; font-size: 9.5pt">targetFolder.Project.QueryHierarchy.Save();</span><strong><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi">&nbsp;</span></strong></p>
<h3>Deleting a query or folder</h3>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: #2b91af; font-size: 9.5pt">QueryItem</span><span style="font-family: consolas; font-size: 9.5pt"> query = &hellip; <span style="color: green">// find the query or folder you want to delete <br /></span></span><span style="font-family: consolas; font-size: 9.5pt">query.Delete(); <br /></span><span style="font-family: consolas; color: #2b91af; font-size: 9.5pt">Project</span><span style="font-family: consolas; font-size: 9.5pt">.QueryHierarchy.Save();</span><span style="line-height: 115%; font-family: 'Segoe UI','sans-serif'; color: #333333; font-size: 9pt">&nbsp;</span></p>
<h2><strong><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi">Complete Sample </span></strong></h2>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; color: blue; font-size: 9.5pt">using</span><span style="font-family: consolas; font-size: 9.5pt"> System; <br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">using</span><span style="font-family: consolas; font-size: 9.5pt"> Microsoft.TeamFoundation.Client; <br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">using</span><span style="font-family: consolas; font-size: 9.5pt"> Microsoft.TeamFoundation.WorkItemTracking.Client; <br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">using</span><span style="font-family: consolas; font-size: 9.5pt"> System.Text;</span></p>
<p><span style="font-family: consolas; color: blue; font-size: 9.5pt">namespace</span><span style="font-family: consolas; font-size: 9.5pt"> WorkItemTrackingSamples <br /></span><span style="font-family: consolas; font-size: 9.5pt">{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: blue">class</span> <span style="color: #2b91af">QueryFolderSample</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">private</span> <span style="color: blue">static</span> <span style="color: #2b91af">Project</span> myproject = <span style="color: blue">null</span>; </span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">static</span> <span style="color: blue">void</span> Main(<span style="color: blue">string</span>[] args)&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af">TfsTeamProjectCollection</span> coll = <span style="color: #2b91af">TfsTeamProjectCollectionFactory</span>.GetTeamProjectCollection(<span style="color: blue">new</span> <span style="color: #2b91af">Uri</span>(<span style="color: #a31515">"TfsCollectionUrl"</span>));&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af">WorkItemStore</span> store = <span style="color: blue">new</span> <span style="color: #2b91af">WorkItemStore</span>(coll);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>myproject = store.Projects[<span style="color: #a31515">"projectName"</span>];&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes">&nbsp;</span><span style="color: green">//Add Folder</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af">QueryFolder</span> myNewfolder = AddNewFolder(<span style="color: #a31515">"My New Folder 1"</span>);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: green">//Add Query</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af">QueryDefinition</span> myQuery = AddNewQuery(myNewfolder);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: green">//Rename the folder</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RenameQueryItem(myNewfolder);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: green">//Add a new folder and move&nbsp; <br /></span></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af">QueryFolder</span> myMovefolder = AddNewFolder(<span style="color: #a31515">"My New Folder 2"</span>);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>MoveQueryItem(myNewfolder, myMovefolder);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: green">//Delete the sample</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>DeleteQueryItem(myMovefolder);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> Create a new "My New Folder" folder under My Queries</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;returns&gt;</span><span style="color: green">Newly created folder</span><span style="color: gray">&lt;/returns&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: #2b91af">QueryFolder</span> AddNewFolder(<span style="color: blue">string</span> folderName)&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af">QueryFolder</span> folder = <span style="color: blue">new</span> <span style="color: #2b91af">QueryFolder</span>(folderName, GetMyQueriesFolder());&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>myproject.QueryHierarchy.Save();&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">return</span> folder;&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt">&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> Adds a query</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;param name="parentFolder"&gt;</span><span style="color: green">Parent Folder where the query will be added</span><span style="color: gray">&lt;/param&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;returns&gt;&lt;/returns&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: #2b91af">QueryDefinition</span> AddNewQuery(<span style="color: #2b91af">QueryFolder</span> parentFolder)&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af">QueryDefinition</span> query = <span style="color: blue">new</span> <span style="color: #2b91af">QueryDefinition</span>(<span style="color: #a31515">"My Query"</span>, <span style="color: #a31515">"SELECT [System.Title] FROM WorkItems WHERE [System.AssignedTo] = @me"</span>, parentFolder);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>myproject.QueryHierarchy.Save();&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">return</span> query;&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> Will rename a QueryFolder or a QueryDefinition</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;param name="folderOrQuery"&gt;</span><span style="color: green">Folder or QUery</span><span style="color: gray">&lt;/param&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: blue">void</span> RenameQueryItem(<span style="color: #2b91af">QueryItem</span> folderOrQuery)&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>folderOrQuery.Name = <span style="color: #a31515">"My Renamed folder"</span>;&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>myproject.QueryHierarchy.Save();&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes">&nbsp;</span>} </span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> Moves a query folder or query</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;param name="query"&gt;</span><span style="color: green">QueryFolder or Query to move</span><span style="color: gray">&lt;/param&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;param name="targetFolder"&gt;</span><span style="color: green">Target Folder</span><span style="color: gray">&lt;/param&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: blue">void</span> MoveQueryItem(<span style="color: #2b91af">QueryItem</span> queryItem, <span style="color: #2b91af">QueryFolder</span> targetFolder)&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>targetFolder.Add(queryItem);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>targetFolder.Project.QueryHierarchy.Save();&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} </span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> Delete Query folder or Query</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;param name="queryItem"&gt;</span><span style="color: green">Folder or QUery to delete</span><span style="color: gray">&lt;/param&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: blue">void</span> DeleteQueryItem(<span style="color: #2b91af">QueryItem</span> queryItem)&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>queryItem.Delete();&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>myproject.QueryHierarchy.Save();&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} </span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;</span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none"><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> Returns the My Queries folder</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;returns&gt;</span><span style="color: green">My Queries folder</span><span style="color: gray">&lt;/returns&gt;</span>&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: #2b91af">QueryFolder</span> GetMyQueriesFolder()&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">foreach</span> (<span style="color: #2b91af">QueryFolder</span> folder <span style="color: blue">in</span> myproject.QueryHierarchy)&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">if</span> (folder.IsPersonal == <span style="color: blue">true</span>)&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">return</span> folder;&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">Exception</span>(<span style="color: #a31515">"Cannot find the My Queries folder"</span>);&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}&nbsp; <br /></span><span style="font-family: consolas; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>} <br /></span><span style="font-family: consolas; font-size: 9.5pt">} </span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/02/60/66/SampleConsoleApplication.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-02-60-66/SampleConsoleApplication.zip">SampleConsoleApplication.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Announcing Team Foundation Server Scrum v1.0 Beta</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/announcing-team-foundation-server-scrum-v1-0-beta</link>
      <pubDate>Mon, 07 Jun 2010 09:27:43 GMT</pubDate>
      <dc:creator><![CDATA[Aaron Bjork]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/06/07/announcing-team-foundation-server-scrum-v1-0-beta/</guid>
      <description><![CDATA[Today , we’re announcing and releasing a brand new process template… Team Foundation Server Scrum...]]></description>
      <content:encoded><![CDATA[<p>Today , we’re announcing and releasing a brand new process template… Team Foundation Server Scrum v1.0 Beta.&#160; This is a new process template built from the ground up specifically for Scrum teams.&#160;&#160; So, why a new template?&#160; Quite simply, because you told us you wanted one.&#160;&#160; Scrum has become a dominant methodology in software development and you have told us that you want a process template aimed directly at Scrum teams.&#160; </p>  <p><a href="https://blogs.msdn.com/b/aaronbjork/archive/2010/05/25/announcing-team-foundation-server-scrum-v1-0-beta.aspx">Read the rest of Aaron Bjork’s article… &gt;</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Change in HTML Field Behavior in the 2010 TFS Excel Integration</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/change-in-html-field-behavior-in-the-2010-tfs-excel-integration</link>
      <pubDate>Wed, 26 May 2010 08:19:33 GMT</pubDate>
      <dc:creator><![CDATA[John Nierenberg_Bing]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/05/26/change-in-html-field-behavior-in-the-2010-tfs-excel-integration/</guid>
      <description><![CDATA[TFS has changed how Excel interacts with HTML fields to only allow HTML fields to be editable on...]]></description>
      <content:encoded><![CDATA[<p>TFS has changed how Excel interacts with HTML fields to only allow HTML fields to be editable on creation of a work item but read only when editing existing work items.</p>  <h4>What was the old behavior?</h4>  <p>With the 2008 TFS Excel Add-In you were able to edit work item HTML fields in Excel, but all of the formatting tags were stripped out, publishing any changes as plain text.</p>  <h4>Why was it changed?</h4>  <p>This behavior prevented teams from using the full power of the HTML fields because they were concerns about data loss. In addition to formatting being lost, html links and other tags were stripped out as well.</p>  <h4>What out of the box work items use HTML fields?</h4>  <p>There are many work item fields that use HTML fields, for example: Repro Steps, Test Steps, System Info, etc. Beyond this set the fields are used to provide refinement information like in a Change Request such as Impact to Arch, Impact to Test, etc. Several customers have proposed we change the Description field type for the Task work item type from ‘PlainText’ to ’HTML’ in a future TFS release.</p>]]></content:encoded>
    </item>
    <item>
      <title>New Work Item Type Controls in TFS 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/team_foundation/new-work-item-type-controls-in-tfs-2010</link>
      <pubDate>Tue, 25 May 2010 15:26:00 GMT</pubDate>
      <dc:creator><![CDATA[jontsao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/team_foundation/2010/05/25/new-work-item-type-controls-in-tfs-2010/</guid>
      <description><![CDATA[The following post was written by Smitha Saligrama, a software development engineer in test for the...]]></description>
      <content:encoded><![CDATA[<p><em>The following post was written by Smitha Saligrama, a software development engineer in test for the work item tracking team in TFS.</em></p>
<p>With the release of TFS 2010, there are some new work item controls you can take advantage of.</p>
<h4>Stand-alone Label</h4>
<p>You can now have a stand-alone label control on the work item form without having to attach the label to another control.</p>
<p>These labels can have </p>
<ul>
<li>Plain text </li>
<li>Static hyperlinks </li>
<li>Dynamic hyperlinks with data coming from work item fields or work item macros </li>
</ul>
<p><strong>Example 1: Stand-alone label with plain text</strong></p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">LabelControl</span>"<span style="color: blue"> </span><span style="color: red">Label</span><span style="color: blue">=</span>"<span style="color: blue">Standalone Label Text</span>"<span style="color: blue"> &gt;&lt;/</span><span style="color: #a31515">Control</span><span style="color: blue">&gt;</span></span></p>
<p>Or</p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">LabelControl</span>"<span style="color: blue">&gt;<br /></span></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Text</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">Standalone label text<span style="color: blue">&lt;/</span><span style="color: #a31515">Text</span><span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="line-height: 115%; font-family: consolas; color: blue; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">&lt;/</span><span style="line-height: 115%; font-family: consolas; color: #a31515; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">Control</span><span style="line-height: 115%; font-family: consolas; color: blue; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">&gt;</span></p>
<p>Output:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/8831.clip_image0027_5C75F0AC.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/8831.clip_5F00_image0027_5F00_5C75F0AC.jpg"><img height="33" width="703" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/0820.clip_image0027_thumb_1C3FD732.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/0820.clip_5F00_image0027_5F00_thumb_5F00_1C3FD732.jpg" alt="clip_image002[7]" border="0" title="clip_image002[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p><strong>Example 2: Stand-alone label with static hyperlinks</strong></p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">LabelControl</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Text</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; color: black; font-size: 9.5pt; mso-themecolor: text1">Follow this link</span><span style="font-family: consolas; font-size: 9.5pt"> <span style="color: blue">&lt;</span><span style="color: #a31515">Link</span><span style="color: blue"> </span><span style="color: red">UrlRoot</span><span style="color: blue">=</span>"<span style="color: blue">https://www.msn.com/</span>"<span style="color: blue">/&gt;</span> Thank you.<span style="color: blue">&lt;/</span><span style="color: #a31515">Text</span><span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="line-height: 115%; font-family: consolas; color: blue; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">&lt;/</span><span style="line-height: 115%; font-family: consolas; color: #a31515; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">Control</span><span style="line-height: 115%; font-family: consolas; color: blue; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">&gt;</span></p>
<p>Output:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/3666.clip_image0047_430DED72.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/3666.clip_5F00_image0047_5F00_430DED72.jpg"><img height="26" width="654" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/6886.clip_image0047_thumb_30C526B0.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/6886.clip_5F00_image0047_5F00_thumb_5F00_30C526B0.jpg" alt="clip_image004[7]" border="0" title="clip_image004[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p><strong>Example 3: Standalone label with dynamic hyperlinks</strong></p>
<p>Supported macros: <span style="font-family: consolas; color: blue; font-size: 9.5pt">@ReportServiceSiteUrl, @ReportManagerUrl, @PortalPage, @ProcessGuidance, @Me&nbsp;</span>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">LabelControl</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Text</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Link</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">UrlRoot</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">@PortalPage</span>"<span style="color: blue"> </span><span style="color: red">UrlPath</span><span style="color: blue">=</span>"<span style="color: blue">{0}/default.aspx</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Param</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Index</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">0</span>"<span style="color: blue"> </span><span style="color: red">Value</span><span style="color: blue">=</span>"<span style="color: blue">System.State</span>"<span style="color: blue"> </span><span style="color: red">Type</span><span style="color: blue">=</span>"<span style="color: blue">Current</span>"<span style="color: blue">/&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Link</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">LinkLabelExample<span style="color: blue">&lt;/</span><span style="color: #a31515">Text</span><span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="line-height: 115%; font-family: consolas; color: blue; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">&lt;/</span><span style="line-height: 115%; font-family: consolas; color: #a31515; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">Control</span><span style="line-height: 115%; font-family: consolas; color: blue; font-size: 9.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa">&gt;</span>&nbsp;</p>
<p><strong></strong></p>
<p><strong>Output:</strong><strong></strong></p>
<p><b><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/0523.clip_image0067_696FD0BD.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/0523.clip_5F00_image0067_5F00_696FD0BD.jpg"><img height="36" width="654" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/4718.clip_image0067_thumb_103DE6FE.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/4718.clip_5F00_image0067_5F00_thumb_5F00_103DE6FE.jpg" alt="clip_image006[7]" border="0" title="clip_image006[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a><strong></strong></b></p>
<p><strong>Url :</strong><strong></strong></p>
<p><b><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/1425.clip_image00812_370BFD3E.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/1425.clip_5F00_image00812_5F00_370BFD3E.jpg"><img height="27" width="605" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/7360.clip_image00812_thumb_56BAD706.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/7360.clip_5F00_image00812_5F00_thumb_5F00_56BAD706.jpg" alt="clip_image008[12]" border="0" title="clip_image008[12]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a><strong></strong></b></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<h4><strong>Link Label</strong></h4>
<p>You can now have links on the labels that are associated with your controls.</p>
<p>Links can be:</p>
<ul>
<li>Static hyperlinks </li>
<li>Dynamic hyperlinks with data coming from work item fields or work item macros </li>
</ul>
<p><strong>Example 1: Link label with static hyper link</strong></p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">FieldControl</span>"<span style="color: blue"> </span><span style="color: red">FieldName</span><span style="color: blue">=</span>"<span style="color: blue">Test.Test1</span>"<span style="color: blue"> </span><span style="color: red">Label</span><span style="color: blue">=</span>"<span style="color: blue">Link Label Example</span>"<span style="color: blue"> </span><span style="color: red">LabelPosition</span><span style="color: blue">=</span>"<span style="color: blue">Left</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Link</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">UrlRoot</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"</span><a href="https://www.msn.com/"><span style="font-family: consolas; font-size: 9.5pt">https://www.msn.com/</span></a><span style="font-family: consolas; font-size: 9.5pt">"/<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;&nbsp;</span> </p>
<p>Or</p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">FieldControl</span>"<span style="color: blue"> </span><span style="color: red">FieldName</span><span style="color: blue">=</span>"<span style="color: blue"> Test.Test1</span>"<span style="color: blue"> </span><span style="color: red">LabelPosition</span><span style="color: blue">=</span>"<span style="color: blue">Left</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Text</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Link</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">UrlRoot</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">https://www.msn.com/</span>"<span style="color: blue">/&gt;</span>Link Label Example<span style="color: blue">&lt;/</span><span style="color: #a31515">Text</span><span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;&nbsp;</span>&nbsp; </p>
<p>Output:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/1106.clip_image0107_5A58F1E3.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/1106.clip_5F00_image0107_5F00_5A58F1E3.jpg"><img height="34" width="551" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/3755.clip_image0107_thumb_01270824.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/3755.clip_5F00_image0107_5F00_thumb_5F00_01270824.jpg" alt="clip_image010[7]" border="0" title="clip_image010[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p><strong>Example 2: Link label with dynamic hyper link</strong></p>
<p class="MsoNormal"><span style="font-family: consolas; color: black; font-size: 9.5pt; mso-themecolor: text1">Supported macros:&nbsp;</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">@ReportServiceSiteUrl, @ReportManagerUrl, @PortalPage, @ProcessGuidance, @Me&nbsp;</span> </p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">FieldControl</span>"<span style="color: blue"> </span><span style="color: red">FieldName</span><span style="color: blue">=</span>"<span style="color: blue"> Test.Test1</span>"<span style="color: blue"> </span><span style="color: red">LabelPosition</span><span style="color: blue">=</span>"<span style="color: blue">Left</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1">&nbsp;&nbsp;</span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Text</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Link</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">UrlRoot</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">@PortalPage</span>"<span style="color: blue"> </span><span style="color: red">UrlPath</span><span style="color: blue">=</span>"<span style="color: blue">{0}/default.aspx</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Param</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Index</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">0</span>"<span style="color: blue"> </span><span style="color: red">Value</span><span style="color: blue">=</span>"<span style="color: blue">System.State</span>"<span style="color: blue"> </span><span style="color: red">Type</span><span style="color: blue">=</span>"<span style="color: blue">Current</span>"<span style="color: blue">/&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;</span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Link</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">Example<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue">&lt;/</span><span style="color: #a31515">Text</span><span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1">&nbsp;</span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">LabelText</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt; </span></p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt"></span>Output:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/6283.clip_image0127_35C7645F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/6283.clip_5F00_image0127_5F00_35C7645F.jpg"><img height="35" width="287" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/0820.clip_image0127_thumb_4084BBB4.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/0820.clip_5F00_image0127_5F00_thumb_5F00_4084BBB4.jpg" alt="clip_image012[7]" border="0" title="clip_image012[7]" style="display: inline; border-width: 0px;" /></a></p>
<p><strong>Url :</strong><strong></strong></p>
<p><b><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/6303.clip_image00813_39657F3C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/6303.clip_5F00_image00813_5F00_39657F3C.jpg"><img height="26" width="595" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/2677.clip_image00813_thumb_34EEFE75.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/2677.clip_5F00_image00813_5F00_thumb_5F00_34EEFE75.jpg" alt="clip_image008[13]" border="0" title="clip_image008[13]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a><strong></strong></b></p>
<h4>Webpage Control</h4>
<p>Webpage controls are now supported.</p>
<p>Webpage controls can have</p>
<ul>
<li>CDATA for rendering HTML </li>
<li>A web page URL for rendering an actual webpage. </li>
</ul>
<p><strong>Example 1: CDATA</strong></p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">WebpageControl</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">WebpageControlOptions</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Content</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;![CDATA[</span><span style="font-family: consolas; color: gray; font-size: 9.5pt">Click here for detailed &lt;b&gt;&lt;a href="https://www.microsoft.com"&gt; on the company&lt;/a&gt;&lt;/b&gt;</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">]]&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Content</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt">&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">WebpageControlOptions</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;</span><span style="font-family: consolas; font-size: 9.5pt"> <br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt; </span></p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt"></span>Output:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/4336.clip_image0147_549DD83D.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/4336.clip_5F00_image0147_5F00_549DD83D.jpg"><img height="176" width="445" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/0447.clip_image0147_thumb_5F5B2F92.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/0447.clip_5F00_image0147_5F00_thumb_5F00_5F5B2F92.jpg" alt="clip_image014[7]" border="0" title="clip_image014[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p><strong>Example 2: Web Page</strong></p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">Type</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">WebpageControl</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">WebpageControlOptions</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">ReloadOnParamChange</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">true</span>"<span style="color: blue">&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Link</span><span style="font-family: consolas; color: blue; font-size: 9.5pt"> </span><span style="font-family: consolas; color: red; font-size: 9.5pt">UrlRoot</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">=</span><span style="font-family: consolas; font-size: 9.5pt">"<span style="color: blue">@PortalPage</span>"<span style="color: blue">/&gt;</span>&nbsp;<br /></span><span style="font-family: consolas; color: blue; font-size: 9.5pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">WebpageControlOptions</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt;<span style="color: #000000;"><br /></span></span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&lt;/</span><span style="font-family: consolas; color: #a31515; font-size: 9.5pt">Control</span><span style="font-family: consolas; color: blue; font-size: 9.5pt">&gt; </span></p>
<p class="MsoNormal"><span style="font-family: consolas; color: blue; font-size: 9.5pt"></span>Output:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/0842.clip_image0167_0CDC4F56.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/0842.clip_5F00_image0167_5F00_0CDC4F56.jpg"><img height="287" width="402" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/42/84/metablogapi/4336.clip_image0167_thumb_047879FF.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-42-84-metablogapi/4336.clip_5F00_image0167_5F00_thumb_5F00_047879FF.jpg" alt="clip_image016[7]" border="0" title="clip_image016[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>]]></content:encoded>
    </item>
  </channel>
</rss>