CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of TeamFoundation
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
397 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
262 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
207 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
199 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
313 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
185 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
173 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