New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets for: Jim Lamb
C#
using System;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
 
class Program
{
    /// <summary>
    /// Create a parent-child link between two work items in a TFS team project collection
    /// </summary>
    /// <param name="args"></param>
by Jim Lamb   April 13, 2010 @ 8:06am
Tags: TFS2010
86 Views
no comments
 
XML
<Import Project="$(MSBuildExtensionsPath32)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<ItemGroup>
  <SourceFiles
    Include="$(SolutionDir)**/*.*"
    Exclude="$(SolutionDir)Package/**/*.*;$(SolutionDir)**/bin/**/*.*;$(SolutionDir)**/obj/**/*.*;$(SolutionDir)**/internal.proj;$(SolutionDir)**/*.*scc;$(SolutionDir)$(SolutionName).zip">
    <Visible>False</Visible>
  </SourceFiles>
</ItemGroup>
<Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'" 
        Inputs="@(SourceFiles)" Outputs="$(SolutionDir)$(SolutionName).zip">
by Jim Lamb   November 03, 2009 @ 11:34am
Tags: MSBuild
115 Views
no comments
 
C#
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
 
// create a new work item linked to an existing item in version control
static void CreateLinkedWorkItem(String teamProject, String workItemType)
{
    using (var tfs = TeamFoundationServerFactory.GetServer(_ServerUri))
    {
        var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
 
by Jim Lamb   October 29, 2009 @ 8:01pm
133 Views
no comments
 
C#
using Microsoft.TeamFoundation.WorkItemTracking.Client;
 
// populate a TreeView with the work item queries for a particular team project
treeView.Nodes.Clear();
 
foreach (QueryItem queryItem in teamProject.QueryHierarchy)
{
    GetNodesForQueryFolder(queryItem as QueryFolder, treeQueryView.Nodes);
}
 
by Jim Lamb   October 29, 2009 @ 7:55pm
72 Views
no comments
 
C#
using Microsoft.TeamFoundation.VersionControl.Client;
 
// query the version control repository for items matching a file specification
// set the folder for the root of your search
String rootFolder = "$/MyProject";
 
// construct the set of item specifications you want to search for
ItemSpec[] itemSpecs = new ItemSpec[] { 
    new ItemSpec(String.Format("{0}/*.sln", rootFolder), RecursionType.Full),
};
by Jim Lamb   October 29, 2009 @ 7:54pm
68 Views
no comments
 
C#
using Microsoft.TeamFoundation.Build.Client;
 
// enumerate the build controllers and agents for the specified project collection
var tfs = TeamFoundationServerFactory.GetServer("http://tfserver:8080/tfs/DefaultCollection");
IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));
 
var buildControllers = (IEnumerable<IBuildController>)buildServer.QueryBuildControllers(true);
 
foreach (IBuildController controller in buildControllers)
{
by Jim Lamb   October 29, 2009 @ 7:49pm
53 Views
no comments
 
C#
using System.Net;
using Microsoft.TeamFoundation;
using Microsoft.TeamFoundation.Client;
 
// Connect to a project collection by Uri
try
{
    Uri projectCollectionUri = new Uri("http://tfs2010:8080/tfs/MyCollection");
    TeamFoundationServer tfs = new TeamFoundationServer(projectCollectionUri, new UICredentialsProvider());
    tfs.EnsureAuthenticated();
by Jim Lamb   October 29, 2009 @ 7:45pm
81 Views
no comments
 
C#
using Microsoft.TeamFoundation.Client;
 
RegisteredProjectCollection[] collections = RegisteredInstances.GetProjectCollections();
 
if (collections != null)
{
    foreach (RegisteredProjectCollection collection in collections)
    {
        Console.WriteLine(String.Format("{0} - {1}", collection.Name, collection.Uri));
    }
by Jim Lamb   October 29, 2009 @ 7:39pm
55 Views
no comments
 
C#
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Build.Client;
 
namespace Microsoft.TeamFoundation.Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            // replace this string with the URI to your team project collection
by Jim Lamb   October 28, 2009 @ 1:39pm
57 Views
no comments
 
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate